Borrar filtros
Borrar filtros

adding float number of different size array

2 visualizaciones (últimos 30 días)
Saiem Solimullah
Saiem Solimullah el 28 de Jun. de 2018
Editada: Mandeep Singh el 28 de Jun. de 2018
How to add or multiply two different size of array using the loop iteration process? suppose ,an array
a=[.1 -.2 .13 .4 -.15 .26 .17 -.28 .19 .21] b=[.1 -.22 .06] and i want increase the size of the 'b' array using. for loop. as like the value of 'b' after using for loop is
= [.1 -.22 .06 .1 -.22 .06 .1 -.22 .06 .1] Then, we will add or multiply this array.That will very much appreciating if anyone can give a matlab code for this problem....

Respuestas (1)

Mandeep  Singh
Mandeep Singh el 28 de Jun. de 2018
Editada: Mandeep Singh el 28 de Jun. de 2018
You can achieve the required values for the matrix b using the following set of commands
a=[.1 -.2 .13 .4 -.15 .26 .17 -.28 .19 .21]
b=[.1 -.22 .06]
bb = repmat(b,[1,round(size(a)/size(b)+1)]) %make repetition of the matrix b
bb = bb(1:size(a,2)) %make the size of matrix bb equal to a

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by