MATLAB: X=(x0,x1,….,Xn0-1) ==> Xhat=(x0,x0,x0,x0, x1,x1,x1,x1, …….. ,Xn0-1,Xn0-1,Xn0-1,Xn0-1), How to copy like this in vector vector X=(x0,x1,….,Xn0-1) ==> Xhat=(x0,x0,x0,x0, x1,x1,x1,x1, …….. ,Xn0-1,Xn0-1,Xn0-1,Xn0-1) How can I copy like in vector? x0 was copied number of 4(or any number) Best Answer xhat = kron(X, ones(1,4)) Related SolutionsMATLAB: How to randomly generate 0.1 or -0.1 diag((2*randi(0:1,1,N)-1)/10) MATLAB: How can i fix this error ? Failure in initial user-supplied objective function evaluation. FMINUNC cannot continue. f=@(x)(1 + (x(1) + x(2) + 1).^2.*(19 - 14*x(1) + 3*x(1).^2 - 14*x(2) + 6*x(1).*x(2) + 3*x(2).^2)).*... (30 + (2*x(1) - 3*x(2)).^2.*(18 - 32*x(1) + 12*x(1).^2 + 48*x(2) - 36*x(1).*x(2) + 27*x(2).^2));Best wishesTorsten. Related QuestionI have a matrix [1 1 1 0; 0 1 1 0;1 1 0 1; 0 0 1 1]Is 0<0.01How to minimize a nonlinear functionEquation: X”-6x’+13x = t+3sin(t) Initial Value: x(0)=1 t є [0,1] Method: Runge-Kutta II Step Sizes: h=0.1 , h=0.03
Best Answer