Filter löschen
Filter löschen

How to write a program which gives output in form of table for students grade and each time i run the program the marks for each student should change randomly?

1 Ansicht (letzte 30 Tage)
Need the program like this type
Student1= 'any random name'
%random marks
marks1= randi(100,1)
%assigning grade
if marks1<100 & marks1>=90
grade1= 'A'
....
end
% NOW THE MAIN PART DISPLAYING THE OUTPUT IN FORM OF TABLE FOR 10 STUDENTS
?????
  1 Kommentar
Dyuman Joshi
Dyuman Joshi am 21 Mai 2022
What have you tried yet? What is the problem/error you are facing? Did you try a simple search on the internet to find any similar problems? Because there are many similar questions just on this forum alone that have been answered!
Don't expect anyone here to write full code for you.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chandra
Chandra am 24 Mai 2022
Hi,
Please refer to writetable function
example
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName)
writetable(T,'myPatientData.dat','WriteRowNames',true)

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by