How to display cell format or table format in GUI table?
11 views (last 30 days)
Show older comments
Siti Khadijah Norzafri
on 19 Mar 2020
Commented: Siti Khadijah Norzafri
on 21 Mar 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 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!