Matlab using subscript variable

1.6k Views Asked by At

I'm trying to write a function in matlab but I don't quite know if it is working. In the equation line i have:

xdot(2) = N_h * x;

to signify: $$\frac{dy}{dt} = N_h \cdot x$$

But should the matlab code be:

xdot(2) = Nh * x

Or is the first one correct? Or are they both correct?

1

There are 1 best solutions below

0
On BEST ANSWER

Quick enough, this test script:

Mh=1;
M_h=2;
disp(Mh);
disp(M_h);

works on Matlab R2009a, this is it prints $$1$$ $$2$$


I'm not really sure if M_h may be recommnded, but Mh and M_h are both valid names for a variable or constant.