The input was too complicated or too big for MATLAB to parse.
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
That isn't going to solve your problem -- which we can't see since you didn't post the actual error message in context nor the specific code that generated it.
Certainly the above code snippet by itself is neither large nor very complicated.
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?
shamal
on 30 Jun 2024
Accepted Answer
More Answers (0)
Categories
Find more on Geometry and Mesh 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!

