フィルターのクリア

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

2 ビュー (過去 30 日間)
Ashraf Afana
Ashraf Afana 2013 年 5 月 17 日
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 Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by