필터 지우기
필터 지우기

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?

조회 수: 2 (최근 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에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by