The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: variables in m files
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 2
Registered: 2/11/13
variables in m files
Posted: Feb 11, 2013 6:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi, I am new to MATLAB. This is the script i am working on:

FC = 360;
d = hex2dec ('001C72');
p = hex2dec ('038E');
t = hex2dec ('0392');
A = (d*0.5*FC/2^18);
B = (p*0.5*FC/2^15);
C = (t*0.5*FC/2^15);

Then writing 'A' in the command window i recieve an output in degrees depending on what the input 'd' in the m file is. My problem is that the hex values of d, p and t will change and will not always equal the same. So is there any way that i can make the hex vales above a variable that i can somehow change without editing the m file everytime?

Many thanks

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.