what is the problem of my 'for loop' in a matrix?

2 次查看(过去 30 天)
I'm trying to define some parameters using for loop in a matrix but all the time I have the following error:
i =
1
Undefined function 'isnan' for input arguments of type 'struct'.
My script is:
clear; close all
inpt=importdata('fw12.xlsx');
wave=inpt.data;
cols=size(wave,2);
lenght=size(wave,1);
if i=1:lenght
i
scan=wave(i,:);
dist=scan(8:cols);
rm=isnan(dist);
a=find(rm == 0);
f=dist(a);
[meanf,stdf,meanf95,std95] = normfit(f);
summart(i,1)=meanf;
summart(i,2)=stdf;
summart(i,3)=meanf95(1);
summart(i,4)=meanf95(2);
summart(i,5)=std95(1);
summart(i,6)=std95(2);
end
Any Suggestion to handle this problem?

采纳的回答

David Sanchez
David Sanchez 2013-5-17
You are using a struct as input variable for isnan function. This isnsn does not work with structs. Follow your code upwards and you will find out that your dist variable is a struct:
inpt -> wave -> scan -> dist
Redifine your variables in order to send a non-struct to isnan.
  1 个评论
Ashraf Afana
Ashraf Afana 2013-5-17
That's fine, but to return my variable 'dist' from structs to matrix I need the function 'struct2dataset', which is available in R2013a and I have R 2012a. So, my next question will be, how can I obtain the 'struct2dataset' function? or how can resolve this problem? Thanks,

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by