Re: Help needed fast
- From: John D'Errico <woodchips@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 21:31:45 GMT
In article
<16140604.1133298459056.JavaMail.jakarta@xxxxxxxxxxxxxxxxxxxxxx>,
Anthony <drag2f2f@xxxxxxxxxxx> wrote:
> I was asking for help with this
>
> h=7
> l=10
> T2=10000
> theta=10:10:80
> W=4350
> T1=(W.*h)./(l.*sind(theta))
> Ry=W-T1.*sind(theta)
> Rx=T1.*cosd(theta)-T2
> R=(Ry.^2+Rx.^2).^(1./2)
>
> I want to include a function in the script that will give me the value for
> theta when R is at its minimum.
> Thanks
You can't "include a function". You need to make
it a function of theta, since this code fragment
is a function of theta.
I'd also recommend putting semicolons after each
line, unless you really love long lines of output.
The function would take theta as its input argument,
and return R as its output. The header line of your
function may look vaguely like
function R = foftheta(theta)
You should read the help for functions, as found
in
help function
or
doc function
HTH,
John D'Errico
--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
Those who can't laugh at themselves leave the job to others.
Anonymous
.
- References:
- Re: Help needed fast
- From: John D'Errico
- Re: Help needed fast
- Prev by Date: Writing to the serial port at 25 Hz
- Next by Date: plot behavior in Matlab 7.1 on Linux
- Previous by thread: Re: Help needed fast
- Next by thread: GARCH model in MATLAB
- Index(es):
Relevant Pages
|