Using an m file in anohter m file

I created an m file with 3 different vectors A = [15 3 22; 3 8 5; 14 3 82] B =[1;5;6] and C = [12 18 5 ] and I need to a create in a single command a 3x3 matrix "D" from the third column of matrix A, the vector B, and the first three elements of vector C.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 6 Sep 2013
Edited: Azzi Abdelmalek on 6 Sep 2013
A = [15 3 22; 3 8 5; 14 3 82];
B =[1;5;6];
C = [12 18 5 ]
D=[A(:,3) B C(1:3)']
Look at horzcat

Categories

Find more on Embedded Coder in Help Center and File Exchange

Asked:

on 6 Sep 2013

Community Treasure Hunt

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

Start Hunting!