Error: Index exceeds the number of array elements (0) on the linspace function
1 次查看(过去 30 天)
显示 更早的评论
I have a following part of a long code that plots two data, Variables (time, value) and frequency ( the same start and end of time of the variables but different values).
The code already does what I want, it plots so many figures until it stops with the following error at the fourth line of the code:
Index exceeds the number of array elements (0).
Error in duration/parenReference (line 17)
that.millis = this.millis(rowIndices);
Error in Erstellungderfrequenzinputbox (line 99)
ftime3=linspace(Uhrzeit(1),Uhrzeit(end),height(freqbereich3));
freq3 = freqbereich3.fb3;
freq3 = double(split(string(freq3(2:end-1)) , ","));
freq3 = freq3(:,1);
ftime3=linspace(Uhrzeit(1),Uhrzeit(end),height(freqbereich3));
freqbereich3.ftime3=ftime3';
nexttile
plot(ftime3(2:end-1),freq3);
hold on
plot(Uhrzeit,Wert)
Uhrzeit is the time and freqbereich3 are both all long tables with values that should have the same length or the same number of values that's why I used the linspace. Any solution or help?
0 个评论
采纳的回答
Walter Roberson
2020-11-27
ftime3=linspace(Uhrzeit(1),Uhrzeit(end),height(freqbereich3));
If Uhrzeit is empty then Uhrzeit(1) would be out of range.
2 个评论
Walter Roberson
2020-11-27
T= [Table1;Table2]; %Aufsummieren der beiden Tabellen in einer.
You do not assign to Table1 or Table2 within the loop, so that assignment is going to do the same thing on every loop iteration. I think you need to insert code that modifies Table1 or Table2
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!