How can I solve this error (Improper assignment with rectangular empty matrix.) with listed below script. Thanks
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Oday Shahadh
el 9 de En. de 2017
Comentada: Walter Roberson
el 9 de En. de 2017
elevtocellsI1=accumarray(OrbNO,elev2,[],@(x) {x});
DDDD=zeros(1,size(elevtocellsI1,1));
for i=1:size(elevtocellsI1,1)
DDDD(i)=(find(elevtocellsI1{i}, 1, 'last' )-(find(elevtocellsI1{i}, 1 )))/60;
end
figure(567432)
bar(DDDD)
title('Passage Time Over the GS')
xlabel('time(Seconds)')
ylabel ('Passage Time (min)'),
grid on
2 comentarios
Stephen23
el 9 de En. de 2017
@Oday Shahadh: please edit your question and give us the complete error message. That means all of the red text.
Also it helps if you give us code that actually works (so that we can run it), otherwise we have to rely on using our magic crystal balls to read what is on your computer monitor.
Respuesta aceptada
Walter Roberson
el 9 de En. de 2017
Some of the cells resulting from accumarray are likely to be empty. find(elevtocellsI1{i}, 1, 'last' ) on the empty cell is going to be empty. (find(elevtocellsI1{i}, 1, 'last' )-(find(elevtocellsI1{i}, 1 )))/60 would then be empty. You try to assign that emptiness to a definite location DDDD(i)
11 comentarios
Walter Roberson
el 9 de En. de 2017
I need to do something else for a while; I will have a look later this evening.
Más respuestas (0)
Ver también
Categorías
Más información sobre Automated Driving Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!