MatLab Subroutine Capabilities for Calculations

조회 수: 1 (최근 30일)
Jay
Jay 2018년 3월 9일
댓글: Jay 2018년 3월 11일
I would like to create a program and would like to know if MatLab can be programmed to do what I require.
If so, what is the best way to achieve the desired calculations that interact at different stages with one another.
Example Values:
Data Set 1
1.1 = 18.556732
1.2 = 25.433254
1.3 = 81.151712
1.4 = 96.304015
Data Set 2
2.1 = 18.556854
2.2 = 25.433242
2.3 = 81.152563
2.4 = 96.314000
Data Set 3
3.1 = 18.556844
3.2 = 25.433333
3.3 = 85.000000
3.4 = 96.313025
Desired Calculation:
Step 1 : Have the GUI ask the user the number of values in the first data set
- The user inputs 4
Step 2 : The GUI asks for the alphabetical level of precision required ("A", "B" or "C")
- The user inputs a letter
- That letter references conditions to be met and those conditions are assessed during the input of each data set.
Eg. The user inputs level "A"
Level "A" requires the following
  1. - The running SD (the SD is recalculated during the run time) for each relative input (1.1, 2.1, 3.1, etc)<= 1.5 .
  2. - The Maximum range between respective values of the datasets be <= 2
  3. - The number of data sets required be >= 10.
This is required for every instance of a new data set of values.
  댓글 수: 5
Jay
Jay 2018년 3월 9일
I only object to other students using my code rather than putting the time and effort into the code writing process (not the general methodology).
Walter Roberson
Walter Roberson 2018년 3월 9일
Specifics are not code. Unless you have gone to the trouble of doing a complete functional breakdown with flow charts and careful interface definitions and data dictionaries and schemas, then your requirements probably do not need to be private.

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

채택된 답변

Walter Roberson
Walter Roberson 2018년 3월 9일
Prompting for values is not difficult in MATLAB.
Generating random values according to specifications is not necessarily difficult, but a lot depends on the kinds of constraints needed. Some kinds of constraints can be a bit tricky to do fairly, such as generating a list of numbers fairly under the condition that the list sums to a particular fixed value. Fairly choosing random permutations of fixed sets can require some work when the set size gets large enough that the entire class of choices does not fit in memory.
  댓글 수: 6
Walter Roberson
Walter Roberson 2018년 3월 9일
Unzip this into a convenient directory and cd there in MATLAB. run the function named driver . This will give you a menu of options. script 1 is an example of a script calling a script. script 2 is a script called directly. function 1 is an example of a function calling a function. function 2 is an example of a function being called directly. function 3 is an example of a function calling a script (which is script 1, so it in turn invokes script 2).
Jay
Jay 2018년 3월 11일
Thank you for taking the time to write that up for me Walter.
It is greatly appreciated.
I will mark the post as answered and try to use the examples given to be used as subroutines.

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

추가 답변 (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