Re: Help needed fast



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
.



Relevant Pages

  • Re: Integration difficulties (@ handle)
    ... > which is dependent on the variable, say theta, and a bunch of ... The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • Re: PseudoInverse
    ... Theta is ... Is there something about the way that the various Matlab matrix ... The answer lies in your expectations. ... The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • wind rose and circular histograms
    ... looking for a script which produces a circular representation. ... With associated values to theta (like rho) I need to summarize ...
    (comp.soft-sys.matlab)