![]() I assume I can attach a plot for you here - if the attachment goes through, that's what the output looked like for me for m=1, c=1, k=1 (critically damped, which looks correct) with an initial stretch of 2 and velocity of 4. ![]() With that correction, your program seems to work. This forces Freemat to do the multiplication element-by-element instead of a matrix multiplication. after the first expression, like so: x=A*exp(-z*w*t.)*sin(wd*t+phi). If you don't, use format short (for 4 places). If you want to see a lot of decimal places (14, to be precise), use the command format long. To do an element-wise multiplication, which is what I assume you want, simply put a. Freemat uses the format command to show you a different number of decimal points within the Command Window for numeric variables. ![]() This results from trying to multiply two matrices whose dimensions don't match up correctly, namely (A*exp(-z*w*t)) and (sin(wd*t+phi)). In C:/Users/tj/Desktop/Vibo_amo.m(Vibo_amo) at line 12Įrror: Requested matrix multiplication requires arguments to be conformant. If you try to run it as is, you'll come up with the error: Also, I gave your program a run, you have a debugging error in line 12. If you want to do further manipulation, you'll want to run it as a script (i.e.: take the first line out, define your variables inside the script explicitly, then you can source the script or just type its filename at the prompt). (Two minor errors due to the difference between MATLAB and FreeMAT, but you can run scripts to end to get the final results and a plot. I downloaded his scripts, and tried to run at FreeMAT. The arguments give you the ability to change the variables at will from the command line, but bear in mind that once the function has executed, you will not be left with any of your calculated variables from inside the function. Marcelo P e rlin shared his MATLAB scripts for Classical Pairs Tra d ing Using MatLab in the MathWorks website. You need to just type the function name with the arguments, like so: Because you specifically named this a function, to which you pass arguments, you can't execute it line-by-line with the source command.
0 Comments
Leave a Reply. |