Also Read
Matlab create random matrix and replace rows and columns
clc %clear screenclear all %clear all variables
mat = rand(3,6) %Create 3 by 6 random matrix.
mat(2, :) = 1:6; %Replace first row with 1 to 6 numbers
replace_first_row= mat
B = rand(1,3); %create 1 by 3 random matrix.
mat(:,3)=B ;%Replace third column with above created matrix.
Replace_third_column = mat







Comments