Hello Everyone, I am new in MATLAB and I want to get result of this code(MATLAB2021a), its run correctly but doesn't show the result. Anyone can help me?? thanks in advance

2 views (last 30 days)
c=[ ];
global d;
c(1,d)= ran(10,21);
function x = ran(min,max)
x= fix ((max-min).*rand(1,1) + min)+1;
end
It should give me number but doesn't show any numbers.
Many Thanks for your help
  4 Comments

Sign in to comment.

Accepted Answer

Cris LaPierre
Cris LaPierre on 12 Jan 2022
Here is perhaps some starter code for you on how to create a MATLAB table.
rowNms = ["WIFI";"WIMAX";"UMTS";"LTE"];
varNms = ["CostperByte","Security","DataRate","PacketDelay","PacketJitter","PacketLoss"];
newNetwork = array2table(zeros(4,6), 'VariableNames', varNms);
newNetwork.Properties.RowNames = rowNms;
for r=1:height(newNetwork)
for c = 1:width(newNetwork)
newNetwork{r,c}=ran(randi(100,1),randi(100,1));
end
end
newNetwork
newNetwork = 4×6 table
CostperByte Security DataRate PacketDelay PacketJitter PacketLoss ___________ ________ ________ ___________ ____________ __________ WIFI 21 47 46 70 61 39 WIMAX 17 57 52 58 80 55 UMTS 65 57 36 51 62 29 LTE 30 29 32 72 19 71
function x = ran(min,max)
x= fix ((max-min).*rand(1,1) + min)+1;
end
  16 Comments
ARAM KHURSHEED
ARAM KHURSHEED on 13 Jan 2022
Exactly, I have to do that, I have no choice, I want to deal withe values inside the table, I will need only the network names (row names) in the end and at that time I have to think about that.
I am doing network ranking.
So, in the last i will need name of network but whole program is not ready, i am doing it partly(script by script).
Best Regards,

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!