For loop problem (Help)
Ältere Kommentare anzeigen
Hi guys , anyone can help me to check my coding ...

Current result, something wrong ...

Desire result , How to get table like this? I'm trying to create an auto data collection software by using GUI.

4 Kommentare
KSSV
am 21 Feb. 2018
Attach code or copy code here....not image snippets....
Guillaume
am 21 Feb. 2018
Pictures of code are not particularly useful. We can't copy/paste the code making it much harder to test/debug/modify/give you a corrected version. Plus, your picture is not particularly sharp, and on my screen I can barely read your code.
Copy/paste the code in your question (then use the {}Code button) or attach it as an m file.
Also gives us a better description of the problem.
zhixuan hong
am 21 Feb. 2018
Guillaume
am 21 Feb. 2018
Code as found in the m file:
subjects={'No', 'IMC(%)','Status'}
fid=fopen('Version_1','w');
fprintf(fid,'%s %s %s \r\n',subjects{:});
for k = 1:n
if x>= 75
No = num2str(n);
IMC = num2str(areaRatio);
Status = 'Pass';
dlmwrite('Version_1',[No IMC Status],'-append','delimiter','\t','precision','%.2f');
else
No = num2str(n);
IMC = num2str(areaRatio);
Status = 'Fail';
dlmwrite('Version_1',[No IMC Status],'-append','delimiter','\t','precision','%.2f');
end
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
