Taylorh140 Posted September 25, 2020 Report Share Posted September 25, 2020 I was working on octave with a simple script: im=[3.5 ;3.5 ;3.5] ip=[1/3 ;2/3 ;3/3]*2*pi w=2*pi*15 % 15Hz signal dt=0.0005; t=0:dt:0.05; th=w.*t; i=im.*(sin(th+ip)); % generate abc to generate 3 sinusoids offset by 120 degrees. However Mathscript seems to choke on (th+ip) I'm not actually sure what operation is happening or rather octave has some type of extension to the addition operation. I like the convenience of the above method. but I can't figure out how to do the same thing in mathscript without a for loop. Quote Link to comment
Taylorh140 Posted September 28, 2020 Author Report Share Posted September 28, 2020 So this apparently is the same with MATLAB: https://www.mathworks.com/help/matlab/ref/plus.html In the section: Add Row and Column Vectors a = 1:2; b = (1:3)'; a + b This simple code will not compile in Mathscript its the same story with Add Vector to Matrix It's just a seemingly basic incompatibility and it seems it has something to do with how vectors are handled in basic operations. unless there is some super secret setting to make these compatible ill just have to find a workaround. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.