The input was too complicated or too big for MATLAB to parse.
6 views (last 30 days)
Show older comments
hi, i've a long code and i receive this error..
To fix it i want to reduce code using vectorialization
for i=1:c
if STR_type(i)==1 %%se sono aggregate
SumCTR_color(b(i),:)= col(i,:); %%cosi nel draw del SumCTR_strum gli do il colore uguale
end
legend_lines(i)=plot(Ax_Eq,XDates,TE_strum(:,i)','DisplayName',STR_name{i},'Color',col(i,:),'LineWidth',width_arr(i));
text(Ax_Eq,r-2,TE_strum(end,i),strcat({' '},num2str(i)),'Color',col(i,:),'Interpreter','none');
%%******** COLORA OOS *********
if app.OOScolorCheckBox.Value %%mi colora di nero da dove inizia solo l'OOS (se ci sono 4 sistemi prende l'OOS piu' recente!!)!
if isdatetime(OOS_strum(i))
[~,xx_]=find(OOS_strum(i)<=XDates,1,'first'); %%max perche prendo l'OOS piu' recente!
plot(Ax_Eq,XDates(xx_:end),TE_strum(xx_:end,i)','Color',"black",'LineWidth',width_arr(i));
end
end
%%******************************
end
how can i do it? this is a small piece of a big code
4 Comments
dpb
on 30 Jun 2024
I've never seen that before and the code itself although it could probably be streamlined, doesn't look all that complicated so one must presume it's tied into what else is going on with the app and the complexity of it.
We, of course, have no hope of running the code because we don't have data nor the gui that it all relies on; the first suggestion I would have would be to comment out the routine entirely from the app and see if you can then load/run the gui alone.
If that fails, you know the problem is more fundamental; if it works, then begin to "divide and conquer" -- comment out all the function except the call and the return/end and see if still runs. Then add in pieces in chunks until it breaks again (presuming you can first get anything to run by eliminating stuff).
However, one would wonder just what is TE_strum and how big is it?
Accepted Answer
Steven Lord
on 30 Jun 2024
What exactly did you expect this section of code to do?
OOS_strum=OOS_strum(:,b);lucadrive-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------app.Eq.equity_stat.oosapp.Eq.equity_stat.oosapp.Eq.equity_stat.oosapp.Eq.equity_stat.oosapp.Eq.equity_stat.oospredyu
Why do you have so many - signs?
Did you intend this to be a visual divider between the command lucadrive and the attempt to index into the app object? If so you're missing a comment character before the first of those minus signs. The code after that string of minus signs also looks like it's missing some spaces between oos and the app variable.
4 Comments
Steven Lord
on 30 Jun 2024
I downloaded the file and opened it up in the Editor. I saw the long string of minus signs on line 39.
s = evalc('dbtype 39 MPV_Draw_Graph.m')
numberOfMinusSigns = nnz(s == '-')
More Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!