Clear Filters
Clear Filters

How to solve this code error in

2 views (last 30 days)
gfgf99
gfgf99 on 31 May 2015
Commented: Manish Joshi on 31 May 2015
k = [1];
l = [5];
n = [6];
m = [8];
re = [k l];
ne = [m re];
cv = re.*ne ;
  1 Comment
Manish Joshi
Manish Joshi on 31 May 2015
re = [1 5] and ne = [8 1 5] both of these contain 2 and three elements respectively whereas in order to use .* both matrices/vectors should have same dimensions.

Sign in to comment.

Accepted Answer

Roger Stafford
Roger Stafford on 31 May 2015
Edited: Roger Stafford on 31 May 2015
The vector 're' has 2 elements and 'ne' has 3 elements, so the element-by-element multiplication re.*ne becomes meaningless. How can you pair two elements with three elements?
  1 Comment
gfgf99
gfgf99 on 31 May 2015
Edited: gfgf99 on 31 May 2015
Thanks for your guidance :)

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!