how can import numeric matrix into NaN matrix?
古いコメントを表示
hey,
i cant import numeric matrix into NaN matrix that i used in my program
i have this IF loop
if (~exist('Salinity,Pressure'));
t(1:n,i)=Temperature(:);
Z(1:n,i)=z(:);
else
t(1:n,i)=Temperature(:);
Z(1:n,i)=z(:);
sal(1:n,i)=Salinity(:);
p(1:n,i)=Pressure(:);
end
the data is still appear as nan matrix in sal and p variables but the loop is work with t and z
how should i do to keep it work with it like others?
thank you .
3 件のコメント
Rajiv Ghosh-Roy
2014 年 3 月 25 日
The first two lines inside the "if" section and the "else" section do the same thing. Thus they will always get updated.
What do you want to do with the exist statement? I don't think you have the correct syntax there. If you are checking for variables, you should do them individually: e.g.
if exist('Salinity', 'var')
sal(1:n,i)=Salinity(:);
end
and then something similar for pressure.
Walter Roberson
2014 年 3 月 25 日
There is no such thing as an "if loop". There are "for loop" and "while loop" but "if statement".
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!