If I have a function with 1 input producing 3 outputs; ran a small program loop to produce multiple outputs; how would I print out the input and 3 values in that order for the first 12 outputs.
1 次查看(过去 30 天)
显示 更早的评论
If I have a function with 1 input producing 3 outputs; ran a small program loop to produce multiple outputs; how would I print out the input and 3 outputs in that order for the first 12 outputs.
I am having trouble formatting a fprintf for 4 values and I want to know if it is possible to stipulate the amount of values I want the fprint to print.
0 个评论
采纳的回答
CS Researcher
2016-5-2
You mean something like this?
fprintf('Input: %d, Output1: %d, Output2: %d, Output3: %d\n', inp, out1, out2, out3);
3 个评论
CS Researcher
2016-5-2
You are not reading the output values from the function assfunct1. Use this:
[a, b, A] = assfunct1(P);
You should see how the functions are used in MATLAB for a better understanding of it. It will help you.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!