From: Thusitha on
Hi,

I have a function like below

function StylizedMMM(pT, pDelta, pAlpha, pEta, pDim, pPhiZero, pSeed)


and I would like to run it using the command line.

This is the way I run the above function

StylizedMMM 80 0.004 0.04 0.05 4 2

When I do this, do I need to use do the following?

T = str2double(pT)
delta = str2double(pDelta)
alpha = str2double(pAlpha)
eta = str2double(pEta)
dim = str2double(pDim)


I mean the str2double stuff, or should Matlab automatically convert them?

The reason I asked is because I am getting errors if I don't do that.

Thanks

Thusitha
From: TideMan on
On May 29, 3:33 pm, "Thusitha " <tsli...(a)hotmail.com> wrote:
> Hi,
>
> I have a function like below
>
> function StylizedMMM(pT, pDelta, pAlpha, pEta, pDim, pPhiZero, pSeed)
>
> and I would like to run it using the command line.
>
> This is the way I run the above function
>
> StylizedMMM 80 0.004 0.04 0.05 4 2
>
> When I do this, do I need to use do the following?
>
>     T = str2double(pT)
>     delta = str2double(pDelta)
>     alpha = str2double(pAlpha)
>     eta = str2double(pEta)    
>     dim = str2double(pDim)
>
> I mean the str2double stuff, or should Matlab automatically convert them?
>
> The reason I asked is because I am getting errors if I don't do that.
>
> Thanks
>
> Thusitha

What language are you using here?
It doesn't seem like Matlab.
For a start, the calling function should be:
StylizedMMM(80,0.004,0.04,0.05,4,2)
i.e., the input arguments in parentheses, separated by commas.
But that will result in nothing much happening because you haven't
specified an output argument.

You need to go to the Matlab Getting Started tutorial.

From: Thusitha on
TideMan <mulgor(a)gmail.com> wrote in message <eabab538-2959-4e10-96e5-ac266be896bc(a)k25g2000prh.googlegroups.com>...

>
> What language are you using here?
> It doesn't seem like Matlab.
> For a start, the calling function should be:
> StylizedMMM(80,0.004,0.04,0.05,4,2)
> i.e., the input arguments in parentheses, separated by commas.
> But that will result in nothing much happening because you haven't
> specified an output argument.
>
> You need to go to the Matlab Getting Started tutorial.

-----------------------------------------------------------------
This is matlab code. I am a intermediate matlab user and have been using it for some time.

The way I call the function is correct (I am calling it from the command window, not from code within matlab.

The question I have relates to running the matlab code in command window.

When a user runs a function in the command window, do we need to cast them to their related primitive types (such as int, double string) e.t.c or does Matlab figure it out itself.

Thanks
From: us on
"Thusitha " <tsliyan(a)hotmail.com> wrote in message <htqi16$8tv$1(a)fred.mathworks.com>...
> TideMan <mulgor(a)gmail.com> wrote in message <eabab538-2959-4e10-96e5-ac266be896bc(a)k25g2000prh.googlegroups.com>...
>
> >
> > What language are you using here?
> > It doesn't seem like Matlab.
> > For a start, the calling function should be:
> > StylizedMMM(80,0.004,0.04,0.05,4,2)
> > i.e., the input arguments in parentheses, separated by commas.
> > But that will result in nothing much happening because you haven't
> > specified an output argument.
> >
> > You need to go to the Matlab Getting Started tutorial.
>
> -----------------------------------------------------------------
> This is matlab code. I am a intermediate matlab user and have been using it for some time.
>
> The way I call the function is correct (I am calling it from the command window, not from code within matlab.
>
> The question I have relates to running the matlab code in command window.
>
> When a user runs a function in the command window, do we need to cast them to their related primitive types (such as int, double string) e.t.c or does Matlab figure it out itself.
>
> Thanks

did you READ and try to COMPREHEND what tideman told you(?)...
in particular, did you look at the recommendation to run the function
in the form
StylizedMMM(80,0.004,0.04,0.05,4,2)
instead of
StylizedMMM 80 0.004 0.04 0.05 4 2

did you then go into your function and look at the difference in how the arguments look like/what they represent(?)...
did you do anything of that(?)...

us
From: Thusitha on
"us " <us(a)neurol.unizh.ch> wrote in message
> in the form
> StylizedMMM(80,0.004,0.04,0.05,4,2)
> instead of
> StylizedMMM 80 0.004 0.04 0.05 4 2
>
> did you then go into your function and look at the difference in how the arguments look like/what they represent(?)...
> did you do anything of that(?)...
>
> us

------------------------------------------------------
I looked under ----> matlab -----> getting started ----> programming ----> scripts and functions ---> functions

Can't see anything relevant.

I normally ask question only if I can't find answers in Google or Matlab help.

The problem is I am not sure how to form the question in this case.