필터 지우기
필터 지우기

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 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