MATLAB Coding ! I have the following statement in one file 1 motor_rad = EtoR(mo
ID: 2247940 • Letter: M
Question
MATLAB Coding !
I have the following statement in one file 1 motor_rad = EtoR(motor_acc);
now I want to create another file 2 named (Etor) with output motor_acc
the Etor file should take an input argument ( degrees ) and turn into radians , and then once the convertion is done,
I want to call the function number 2 using file number
motor_rad = EtoR(motor_acc); which takes the converted radian angle from Etor file 1
I have made the following ( file # 2) but it does not work at all
function [motor_acc] = Etor(x)
motor_acc= degtorad(x);
end
Explanation / Answer
EtoR File-> Save the below code in EtoR.m file:
*************************************************
function motor_acc = EtoR(x)
motor_acc= deg2rad(x);
end
***************************************************
Now call the function EtoR() as below:
motor_rad = EtoR(x)
Probably you are making a mistake of alphabat small/capital letter. Pl. note the difference between EtoR and Etor.
Pl. see and check.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.