Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The problem was immediately apparent in MATLAB's workspace window; your script creates a stack of variables and two vectors: t and y ...and they were of different length (1 x 101 and 1 x 100 respectively).
Without trying to understand your code, differing length vectors always raise a warning flag in my mind since the operations you can do with them are restricted. Since you received the warning about mismatched matrix dimensions, the "+" operator is attempting to do something it can't (like add them).
Shortening one vector or lengthening the other was worth a try...
Since tinkering with y meant having to understand your loop, I adjusted the limits of t.
Changing: t=0:0.001323:0.1323;
To: t=0:0.0013230.1323-0.001323);
Did the trick. I now have 100 y values that probably mean more to you than they do to me!
Enjoy
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.