Creating vectors with components

How do I create a 5-element column vector whose components are the squares of the elements of vector Row

2 Commenti

Look at transpose and basic matrix operations
What do you want to do if the vector Row is not exactly 5 elements long ?

Accedi per commentare.

Risposte (1)

r=[3 2 7 5 2]
r(1:min(5,end)).^2.'
or
r(1:min(5,end)).'.^2

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Tag

Risposto:

il 21 Set 2019

Community Treasure Hunt

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

Start Hunting!

Translated by