Info

This question is closed. Reopen it to edit or answer.

Pull the numbers from the first column that's before the minimum of the second column

1 view (last 30 days)
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 Comment
dpb
dpb on 13 Jun 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...

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!