How to execute matrix variable values as iterations?

조회 수: 2 (최근 30일)
건희 이
건희 이 2022년 6월 1일
편집: Voss 2022년 6월 1일
In the GUI like in the first picture, there are 6 values
Enter the values. Press the 'loopExecute' button to execute the repeat statement as shown in the third picture.
The iteration statement is executed in a double manner and is operated by the assigned values as shown in the second picture.
But it doesn't work. The operating principle I want is as follows.
For example, if 'Seed' has a step of 0.5 from 2 to 7, the values of 2, 2.5, 3, 3.5... 6.5, and 7 are assigned to 'Channel_Seed.txt', and the exe file reads the values in order to perform the program.
I need your help.
  댓글 수: 4
Voss
Voss 2022년 6월 1일
편집: Voss 2022년 6월 1일
("Answer" from @건희 이 moved here:)
function pushbutton_loopExecute_Callback(hObject, eventdata, handles)
global StartSeed;
global StopSeed;
global StepSeed;
global StartEbN0;
global StopEbN0;
global StepEbN0;
for Channel_Seed = [StartSeed:StepSeed:StopSeed]
for Channel_EbN0 = [StartEbN0:StepEbN0:StopEbN0]
writematrix(Channel_Seed);
type 'Channel_Seed.txt';
writematrix(Channel_EbN0)
type 'Channel_EbN0,txt';
system('"Decoding.exe" arg0 arg1');
systme('"DeModulation.exe" arg0 arg1');
end
end
Voss
Voss 2022년 6월 1일
편집: Voss 2022년 6월 1일
@건희 이: I think @Jan was asking you to explain what you mean when you say, "it doesn't work", i.e., How is the behavior you see different than what you hope to see? You've given a description of how it should work, so now we know that much, but what do you actually observe when you run the code?
By the way, if the exe expects a file called ch.txt, then you better create that file in your loop (instead of creating Channel_Seed.txt):
writematrix(Channel_Seed,'ch.txt');
(and probably you'd want to put that file in the same directory where the exe is, not in MATLAB's working directory.)

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by