有沒有像MATLAB中的.Add()函數? 我有空隙(在第一步)陣列,我願把過濾實驗數據(我不知道我會多少數據實驗中找到)在C#語法很簡單:array.Add()in matlab
List<T> filteredData = new List<T>(); // declare and initialize 'array' of unknown length(right now it 0) typeof T
.
.
//do something and find proper result - "value" variable
//save it to filtered array
filteredData.Add(value); // now length of filteredData == 1
而且這裏去MATLAB:
filteredArray = [];
%...
for n =2 : count -1
foundedValue = experimentData[n];
% how to do
%filteredArray.ADD(foundedValue) ??
end
您可能需要使用 「發現」 而不是 「成立」。 Found是過去分詞find和found是其他動詞的過去,具有不同的含義(構建,建立,融化) –
@VladimirFrolov:'append'是用於mupad對象的,而不是用於「正常」的matlab數組 – Daniel