Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Error in matlab Improper assignment with rectangular assignment with rectangular matrix

1 vue (au cours des 30 derniers jours)
Ede gerlderlands
Ede gerlderlands le 24 Juin 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
hey matlab friends;
I want to find the locatons of matrixpoints which is given by comtime=[4449,1] from a matrix Tt= [5400,1] and i tried using a function
for kk= 1:4449
loc(kk)=find(Tt=comtime(kk,1))
end
bur an error message which says 'Improper assignment with rectangular assignment with rectangular matrix' keeps coming. What can I do with it? thanks for your help.

Réponses (1)

Tom
Tom le 24 Juin 2013
The number of elements you'll find each time will be different, so you can't put them into a standard array. Try using a cell array instead:
loc = cell(4449,1);
for kk= 1:4449
loc{kk}=find(Tt == comtime(kk,1))
end
You can then access each one using the {} notation, e.g.
loc{1}
  8 commentaires
Ede gerlderlands
Ede gerlderlands le 24 Juin 2013
It's a long series and I don't know. That's what am looking for.
Jan
Jan le 24 Juin 2013
Please consider rounding errors: The decimal comma seems to show, that the data are not written by Matlab. Comparing values like 734869.006944445 exactly can be tricky, because this could be rounded.

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by