fprintf matrix question. Need help.
Afficher commentaires plus anciens
Using the repeated feature of fprintf() function in MATLAB, your program must display the results in the following format:
The force in link (I)= XXXX.XX N
The force in link (I)= XXXX.XX N The force in link (-)= ------- N
-------------------------------
Where I refers to the link number (1-8) in format %i and XXXX.XX is the corresponding force value in that link in %g format.
Réponse acceptée
Plus de réponses (1)
Deepak Kumar
le 11 Oct 2019
Please refer the below documentaion to understand the uses of fprintf function
Also, I have written the below code to print the value of
at the values x=1:8 using for loop. You can refer this code and make changes as per your requirements.
clc
clear all
for x=1:8
fprintf('The value in link(%d)=%4.2f N\n \n',x,exp(x))
end
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!