Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Ashraf Afana
Ashraf Afana el 17 de Mayo de 2013
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?

Respuesta aceptada

David Sanchez
David Sanchez el 17 de Mayo de 2013
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 comentario
Ashraf Afana
Ashraf Afana el 17 de Mayo de 2013
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,

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by