Basics

  • Follow


Hi,
I am new user of Matlab. so my questions are of very basic level :-).
1. how the signal values are defined? e.g.
kLa = mxGetPr(PAR(S))[95];

this is one command in matlab c file. Now what i understand is i will get the value of kLa from PAR(s) file at indicis number 95? But in my files that's not the case. Can anybody explain?

2. if i want to see just for the above command what value i will get in result, is there any way to see that?  More clearly just the value of kLa not the entire file.

Thanks!
0
Reply Zia 3/10/2010 7:13:03 AM

"Zia " <ziagemini@hotmail.com> wrote in message <hn7gpv$j4j$1@fred.mathworks.com>...
> Hi,
> I am new user of Matlab. so my questions are of very basic level :-).
> 1. how the signal values are defined? e.g.
> kLa = mxGetPr(PAR(S))[95];
> 
> this is one command in matlab c file. Now what i understand is i will get the value of kLa from PAR(s) file at indicis number 95? But in my files that's not the case. Can anybody explain?

No. Not without seeing your source code.

> 2. if i want to see just for the above command what value i will get in result, is there any way to see that?  More clearly just the value of kLa not the entire file.

If this is a mex file, then

mexPrintf("kLa = %g\n",kLa);

If this is an engine application, then

printf("kLa = %g\n",kLa);

James Tursa
0
Reply James 3/10/2010 7:22:07 AM


Hi,

I figured out the first problem. But still the second problem is not solved. Can anybody help when i am trying to give the following command given by James (above)
mexPrintf("kLa = %g\n",kLa);
i am getting the following error:
??? mexPrintf(kLa = %g\n",kLa);
                  |
Error: The expression to the left of the equals sign is not a valid target for an assignment.

Can anybody tell me how i can figure this out. And is there any way to track the inputs?

Regards1
0
Reply Zia 3/10/2010 2:27:04 PM

"Zia " <ziagemini@hotmail.com> wrote in message 
news:hn8a7o$4nk$1@fred.mathworks.com...
> Hi,
>
> I figured out the first problem. But still the second problem is not 
> solved. Can anybody help when i am trying to give the following command 
> given by James (above)
> mexPrintf("kLa = %g\n",kLa);
> i am getting the following error:
> ??? mexPrintf(kLa = %g\n",kLa);
>                  |
> Error: The expression to the left of the equals sign is not a valid target 
> for an assignment.
>
> Can anybody tell me how i can figure this out. And is there any way to 
> track the inputs?

Hold on a second.  Where are you typing this mexPrintf call?  If you're 
typing it into the MATLAB prompt, that will not work.  Routines like 
mexPrintf are intended to be used in a C or Fortran file that is then 
compiled and used like a regular function; those files are called MEX-files. 
They are not intended to be used directly from the MATLAB prompt.  In 
general, any command that starts with the word "mex" can't be used from the 
MATLAB prompt -- one of the notable exceptions is the MEX command itself.

I recommend you read through the Getting Started section of the MATLAB 
documentation, to give you an introduction to MATLAB syntax and how it works 
in general.  You can access this documentation by typing the following 
command at the MATLAB prompt:

    doc matlab

There should be a link titled "Getting Started" in the right frame of the 
Help Browser window that appears when you execute that command.  If there 
isn't, expand the MATLAB item in the left frame and click on the Getting 
Started item there.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ 


0
Reply Steven 3/10/2010 2:40:51 PM

3 Replies
264 Views

(page loaded in 0.026 seconds)

Similiar Articles:













7/16/2012 9:55:13 AM


Reply: