two dimensional for loop - "matrix dimensions must agree"

Receiving this error when running Matrix dimensions must agree.
Error in untitled (line 34)
Dp2p(i, j)= ( (N.*F) ./ (Us + u) )
%% ECE440 HW4
clc
clear all
%%Building matrixes
syms N F U dmin Ui Us
F = 18*10^9 ;%bites
dmin= 2*10^6 ;%download rate
Us= 30*10^6 ;%upload rate
%%Solving
N = [1000, 10,000, 100,000];
u = [350*10^3, 700*10^3, 2*10^6];
%%Client Server
for (i=N) ;
Dcs1= (N*F)/ Us;
Dcs2= F/ dmin;
end;
%%P2P Server
for i=1:length(N)
for j=1:length(u)
Dp2p(i, j)= ( (N.*F) ./ (Us + u) )
end
end

 採用された回答

Massimo Zanetti
Massimo Zanetti 2016 年 10 月 7 日

4 投票

Do not use commas to separate decimals as in
N = [1000, 10,000, 100,000];
In matlab commas are only to separate between array elements, in rows.Fix by putting:
N = [1000, 10000, 100000];

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by