How to display cell format or table format in GUI table?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Siti Khadijah Norzafri
am 19 Mär. 2020
Kommentiert: Siti Khadijah Norzafri
am 21 Mär. 2020
Hi Im really in need of help on how to display cell format or table format in GUI table. And I tried using uitable it worked but it does'nt update the data. So I now i just want to know how to display it on the GUI table.
Begining=5000;
YI=0.1; %Yearly Interest
Payment=1000; %Monthly Payment
Data=zeros(1,5); %Data result array
x=1; % x and y are counters
y=1;
while Begining>Payment && Begining>0
%Non Calculated Data
Data(y,x)=Begining; %Saving to Array
x=x+1; %Adding Column Index
Data(y,x)=Payment;
x=x+1;
%Calculations
MI=(Begining*YI)/12; %Monthly Interest
Data(y,x)=MI;
x=x+1;
Principal=Payment-MI; %Principal Payment
Data(y,x)=Principal;
x=x+1;
Ending=Begining-Principal; %Ending Balance
Data(y,x)=Ending;
x=1; %Resetting Column Index
if Payment<=MI
break;
end
Begining=Ending; %Setting New Begining Balance
y=y+1; %Adding Row Index
end
if Payment<=MI
fprintf('Invalid Data, Insuficient Payment');
else
%Final Iteration
Begining=Ending;
Data(y,x)=Begining;
x=x+1;
Data(y,x)=Payment;
x=x+1;
MI=0;
Data(y,x)=MI;
x=x+1;
Principal=Payment;
Data(y,x)=Principal;
x=x+1;
Ending=0;
Data(y,x)=Ending;
x=1;
Data2=num2cell(Data); %Converting into cell
%Converting into Table
Data3=cell2table(Data2,'VariableNames',{'Begining Balance','Payment','Interest','Principal','Ending Balance'});
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!