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 次查看(过去 30 天)
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 个评论
Dyuman Joshi
Dyuman Joshi 2022-5-21
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.

请先登录,再进行评论。

回答(1 个)

Chandra
Chandra 2022-5-24
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)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by