Running a Function of 3 Variables

조회 수: 1 (최근 30일)
Scott Telford
Scott Telford 2014년 10월 25일
댓글: Rick Rosson 2014년 10월 25일
Hi all,
I currently have written a piece of code in which 3 variables are run through a series of equations and a final value at the end is determined. For information, the 3 variables are:
Thickness, Height and Channel Gap.
I am wanting my function to include every single combination of these 3 variables. For each variable there are 20 values, so this is a large number of combinations. Ideally at the end of the function, a graph will be plotted which shows the final value at the end of the function compared to each combination. This will enable me to find the most efficient design for the component I am producing.
I am fairly inexperienced with Matlab and have tried to use the 'For x1 = 1:20 For x2 = 1:20 For x3 = 1:20' command however I cannot get this to work correctly.
I can provide a copy of the code if this will help you to answer my question. Please don't hesitate to ask any questions.
Thanks in advance!
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2014년 10월 25일
Scott - you mentioned that you tried to use three for loops, and it didn't work correctly. Please elaborate and describe what the problem is. Was there a particular error or..?
Rick Rosson
Rick Rosson 2014년 10월 25일
Yes, please post your code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by