[Scilab-users] surf and %nan
Rafael Guerra
jrafaelbguerra at hotmail.com
Tue Nov 21 22:02:18 CET 2017
(now without a typo)
The original syntax can be fixed by feeding the a,b indices found as a 2xN matrix [a;b] into M:
x=1:100; y=1:200;
M= x.*.y';
M(10,11:99)=-999;
M(13,13)=-999;
M2 = M;
[a,b]=find(M==-999);
M([a;b]) = %nan; // proper away of feeding indices into M
M2(M2==-999)= %nan;
M(isnan(M))=%pi;
M2(isnan(M2))=%pi;
-->max(M2-M)
ans =
0.
-->min(M2-M)
ans =
0.
Regards,
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20171121/1dfa34c7/attachment.htm>
More information about the users
mailing list