MATLAB Projects

An array of variable-length arrays of integer numbers in matlab

I want to create an array of variable-length arrays of integer numbers in matlab. In fact i want to create a set of paths and I want to have the index of min path in the end of it. I tried to solve it with cell in matlab but i can't solve it in a good way. Can someone propose a better solution?

My solution:[code]total=numel(Graph(:,1)); path=zeros(1,total); paths=cell(total); for i=1:total for j=1:total if(path(index)==Graph(j,2)) if(ismember(Graph(j,1),S)==true) index=index+1; path(index)=Graph(j,1); count=count+1; end end lengths(jj)=count; end for kk=1:numel(path) paths(i,kk)={path(kk)}; end end[/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir