Why my function do not work and gives me an error message?
Ältere Kommentare anzeigen
function [y] = SEM(x)
% Find out the each column of standard error for a matrix
% x should be a nxm matrix or 1xm
y = nanstd(x)./sqrt(length(x) - sum(isnan(x)));
disp(y);
end
Command window:
>> x=weightm;
>> y=SEM(x)
Subscript indices must either be real positive integers or logicals. Error message: Subscript indices must either be real positive integers or logicals.
1 Kommentar
Morteza Hajitabar Firuzjaei
am 29 Jan. 2018
Dear friend,
you used indices, you should make sure you are using integers as indices or make sure you are using vectors or matrices
best wishes
Morteza Hajitabar Firuzjaei
Akzeptierte Antwort
Weitere Antworten (1)
Morteza Hajitabar Firuzjaei
am 29 Jan. 2018
0 Stimmen
Dear friend,
you used indices, you should make sure you are using integers as indices or make sure you are using vectors or matrices
best wishes
Morteza Hajitabar Firuzjaei
Kategorien
Mehr zu Elementary Math finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!