how to fill pre allocated matrix using two columns vectors
Afficher commentaires plus anciens
Matrix = zeros(5)
interval range =10
X = [ 35;43;22]
Y = [75;44;67]
40
50
Y 60
70
80
10 20 30 40 50
X - axis
how to fix these values inside the above grid using matlab coding.
i have tried a lot using for loops but its not comming correct.
All cooperation is highly appreicated.
Regards
1 commentaire
Shashank Sharma
le 26 Juin 2019
It is unclear as to what you are attempting.
What is the expected output of your code ?
Réponse acceptée
Plus de réponses (2)
KSSV
le 26 Juin 2019
X = [ 35;43;22] ;
Y = [75;44;67] ;
[X,Y] = meshgrid(X,Y);
madhan ravi
le 26 Juin 2019
% Illustration
Matrix = zeros(5);
X = (10:10:50).'; % column vectors
Y = (40:10:80).';
Matrix(end,:) = X.';
Matrix(:,1) = Y
5 commentaires
M.S. Khan
le 26 Juin 2019
M.S. Khan
le 26 Juin 2019
madhan ravi
le 26 Juin 2019
Show how your result should look like?
M.S. Khan
le 26 Juin 2019
Modifié(e) : madhan ravi
le 26 Juin 2019
madhan ravi
le 26 Juin 2019
Honestly, how are the certain fields yellow?
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
