6 views (last 30 days)

Show older comments

hey

i have problem with importing data to matlab

i have 2 groups of cells

A = {

[0.2 0.3 0.4 0.5]

[0 0 0.1 0.2]

[0 0 0.1 0.2]

[0 0 0.1 0.2]

[0 0 0.1 0.2]

[0 0 0.1 0.2]

[0 0 0.1 0.2]

[0 0 0 0]

[0 0 0 0]

[0 0 0 0]

[0 0 0 0]

[0 0 0 0]

[0 0 0 0]

[0.8 0.9 1 1]

[0 0 0.1 0.2] }

and B = {

64960.00

380.00

270.00

480.00

360.00

120.00

540.00

253.00

998.00

1352.00

3852.00

2960.00

13562.00

650.00

1100.00 }

when i add it manually and use this loop

D = cell([15 1]);

for ii=1 : numel(A)

D{[ii]} = A{[ii]}().*B{[ii]}();

end

my answer is correct.

but when i add the first data from excel my answer is wrong . in first way i gain cell of D that the value is 15*1

and each cells have 4 items (4 *1)

but in second way i get D with 15*1 cell value but each cells have their own value . for example first one is 1*17 dubble

and second the eight one is 1* 9 !!!!

i dont know how to get my correct answer

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

Start Hunting!