How to check 871 inputs in same if else block?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sandashi
am 11 Jun. 2023
Beantwortet: Sandashi
am 12 Jun. 2023
Please help me to resolve this, i am new to simulink and have time-sensitive research work.
I have set of constant inputs (871 of different values from 413.16 to 500.16 incremented by 0.1) which need to be proceed in a set of arithmatic steps and finally check which of them having outputs greater than 1? i need to selct first input which is having output greater than 1? i have tried to input for loop for it but not succeed.
i will attach my developed model where i have bud up logic only for one constant? ( in this else block i want to repeat same process untill get sum geater than 1)
please help me....
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1408474/image.png)
2 Kommentare
Raghava S N
am 12 Jun. 2023
Step 1: Write your inputs into a variable.
Step 2: Convert that variable into a mat file by running the save command.
Step 3: Convert the .mat file into a Simulink compatible dataset.
inputData = 413.16:0.1:500;
save('inputData.mat','inputData');
success=convertToSLDataset('inputData.mat','SimulinkInputData.mat');
Step 4: Add an inport to your Simulink model. Under the Main tab in the block parameters, click on the connect inputs button. This opens the root input mapper dialogue box.
Step 5: Click the From MAT-file button in the Links section of the toolstrip in the root input mapper
Step 6: Browse to SimulinkInputData.mat and include it. Set the map mode to port order under the map configurations section of the root input mapper toolstrip. Click on save in the root input mapper and give it any name. Click on apply to model in the root input mapper and close the dialogue box.
Step 7: In the Signal attributes tab of the block parameters dialogue box of the iport, set variable signal size option to no and port dimensions to the input size of your array.
Step 8: add an output port as your output.
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Sources finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!