Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Using the loop 'while', find the diameter from a set of data?

Subject: Using the loop 'while', find the diameter from a set of data?

From: J K

Date: 27 Apr, 2013 16:04:08

Message: 1 of 1

I calculate the value of F from equation. From the F that I determined, I need to find the diameter from set of data.

THe method is like this. If my F value is smaller than the value of F from the data, then I choose the corresponding diameter.

For example. The value of F that I calculated is 110. The value of F from the data is 80, 100, 120, 140, 160. The first value is 8, final value is 16, and its corresponding diameter is 3,5,7,9,11.

The data look like this
diameter F
3 80
5 100
7 120
9 140
11 160

110 is bigger than 80, the first value of the data, hence we move to the next F on the data. Again, 110 is bigger 100, we move to the next F.

But 110 is less than 120, the iteration is stop. We need not look further. We take the diameter of 120, which is 7. (Note: I don't need to do interpolation to get the diameter)

You get the idea.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us