Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Pull the numbers from the first column that's before the minimum of the second column
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi guys. I'm super new to MATLAB and I'm doing a school assignment. Already emailed the professor for help but he hasn't responded yet =/. If anyone can help I would appreciate it!
here's my code
clear
clc
Lc=input('Cable Length') %in meters
Lb=input('Enter Beam Length') %in meters
W=input('Weight') % in Newtons
D=(0.1+(Lb-.2))*rand(1,20) %distance
D=sort(D, 'ascend')
T=(Lb*Lc*W)./(D.*(Lb^2-D.^2).^(1/2)) %tension formula
[mini,loc]=min(T) %mini is minimum value, Loc is location and usually is 10 or 15
DT=[D' T'] %distance and tension into 2 columns of same matrix
min(DT(:,2))
I need to create a table of the distance values: the one before the minimum tension, the one where the minimum tension occurs and the one after the minimum tension.
1 comentario
dpb
el 13 de Jun. de 2014
Well, being homework, I'd hope you didn't e-mail the prof with the same form as you posted here. :) If so, I'd hope he either doesn't respond or responds rather negatively.
Marks, however, for at least posting what you have done, still not enough to earn a direct solution but a
HINT:
You're almost there, you saved a location once, why didn't you later on? From that piece of info you should be able to work out all the other issues altho you may want to review the "Getting Started" section on array manipulation in general and colon (:) in particular...
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!