Working With Cosine In a Matrix
Mostra commenti meno recenti
I'm trying to work with cosines in a matrix (For the Freudenstein Equation)but but then am getting a pretty consistent error. Here's the line that has a problem:
TermA = [cos(precOutputAngle1Rad),(-cos(precInputAngle1Rad)),1;
cos(precOutputAngle2Rad),(-cos(precInputAngle2Rad)),1;
cos(precOutputAngle3Rad),(-cos(precInputAngle3Rad)),1];
The error just reads 'Error in FindTransmissionAngles (line 3)' and the line in bold is the said line. I'm thinking the error is something obvious so Id like someone to point out to me and Id really appreciate that.
NB: dpb edit to format the code line removed bold to introduce code format but did not change anything other than spacing for legibility...
5 Commenti
Hi,
is there some more red error text?
To help you it is useful to get the whole error message and the related code. Please format the code after inserting it, by marking it and pressing {}Code - this makes it easier to read.
If you can not insert it, you can attach .m-files and data files needed to execute the code and reproduce your problem.
Until now we only know, that you probably want a matrix A of form
[cos(Out1) -cos(In1) 1;
cos(Out2) -cos(In2) 1;
cos(Out3) -cos(In3) 1]
and that for some reason this doesnt work. But we do not know anything about the In / Out values and its data type or what exactly is going wrong.
As you can see here in the following example it should work:
>> A = [cos(39), -cos(12), 1;...
cos(35), -cos(19), 1;...
cos(89), -cos(10), 1]
A =
0.266642932359937 -0.843853958732492 1.000000000000000
-0.903692205091507 -0.988704618186669 1.000000000000000
0.510177044941669 0.839071529076452 1.000000000000000
So to help more information is needed.
Best regards
Stepan
Edwin Macharia
il 16 Lug 2018
Stephan
il 16 Lug 2018
Hi, i cant find any attachments
Guillaume
il 16 Lug 2018
Edwin, as per Stephan's initial request, give us the full text of the error message. Everything in red.
So far, we know that the line produces an error, but the important bit that tells us why it produces an error, you haven't given us.
Edwin Macharia
il 16 Lug 2018
Risposte (0)
Categorie
Scopri di più su Multirate Signal Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!