Effacer les filtres
Effacer les filtres

Add letter information to the table

2 vues (au cours des 30 derniers jours)
Dursun ÖNER
Dursun ÖNER le 22 Mai 2020
Commenté : Dursun ÖNER le 22 Mai 2020
Hi, dear all
I want to creat list on table and have letter information in this list. But i don't this. Can you help me? I use Matlab r2013a.
If the letters are A instead of AA, the output looks like the picture
close all;
clear all;
clc ;
ogrenci=input('Kaç öğrenci olduğunu giriniz= ');
Ogrencibilgileri=zeros(ogrenci,5);
ortalamaharfkarsiligi=zeros(ogrenci,1);
for i=1:ogrenci;
ogrencisayisi=input('Öğrenci namarasını giriniz= ');
vize=input('Öğrencinin vize notunu giriniz= ');
if vize>100 && vize<0
fprintf('100 sayisinden büyük sayi ve ya 0 sayısından küçük sayı girdiniz')
vize=input('Öğrencinin vize notunu giriniz= ');
end
final=input('Öğrencinin final notunu giriniz= ');
if final>100 && final<0
fprintf('100 sayisinden büyük sayi ve ya 0 sayısından küçük sayı girdiniz')
final=input('Öğrencinin final notunu giriniz= ');
end
ortalama=((vize*40)/100)+((final*60)/100);
if ortalama>=85 && ortalama>=100
ortalamaharfkarsiligi='A'; % i wanna AA
elseif ortalama<85 && ortalama>=75
ortalamaharfkarsiligi='B'; % i wanna BA ....
elseif ortalama<75 && ortalama>=65
ortalamaharfkarsiligi='B';
elseif ortalama<65 && ortalama>=57
ortalamaharfkarsiligi='C';
elseif ortalama<57 && ortalama>=50
ortalamaharfkarsiligi='C';
elseif ortalama<50
ortalamaharfkarsiligi='F';
end
ColumnName={'Öğrenci Numarası','Vize Notu','Final Notu','Ortalama','Harf Notu'};
ortalamaharfkarsiligi((i),1)=ortalamaharfkarsiligi{:}; %----->> WRONG : Cell contents reference from a non-cell array object.
%AND
% if final=90 and vize=90
% Subscripted assignment dimension mismatch.
% Error in Untitled (line 49)
ortalamaharfkarsiligi((i),1)=ortalamaharfkarsiligi(:);
Ogrencibilgileri((i),1)=ogrencisayisi;
Ogrencibilgileri((i),2)=vize;
Ogrencibilgileri((i),3)=final;
Ogrencibilgileri((i),4)=ortalama;
Ogrencibilgileri((i),5)=ortalamaharfkarsiligi; % line to print LETTER where it appears in the picture BUT DON'T WORK
if i==ogrenci
f = figure;
uit =uitable(f,'Data',Ogrencibilgileri,'ColumnName',ColumnName);
end
end
  2 commentaires
per isakson
per isakson le 22 Mai 2020
Regarding
ortalamaharfkarsiligi((i),1)=ortalamaharfkarsiligi{:};
What kind of value do you expect ortalamaharfkarsiligi to have before executing this statement?
And what kind of value do you expect ortalamaharfkarsiligi to have after this statement is executed?
Dursun ÖNER
Dursun ÖNER le 22 Mai 2020
Create a array and I want to sort the letters to the place I showed in the picture for each student

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by