Answered
How to "partner" 2 matrixes
X=[4 7 1 9; 3 0 6 8] idx=randsample(1:numel(X),numel(X)); shuffled_X=reshape(X(idx),size(X,1),[]) Y=[32 6 4 21; 77 89...

7 years ago | 0

Answered
substitution of values in a symbolic function with multiple variables
EDITED See subs() for more examples syms x y z %an example f=x.^+y.^2+z.^2; x1=1:10; x2=11:20; x3=21:30; vpa(subs(f,{x,y,...

7 years ago | 3

Answered
delimit cells to columns with strings and numeric values
Try using readtable() to read the text file

7 years ago | 0

| accepted

Answered
'ODE 23: Error using vertcat Dimensions of matrices being concatenated are not consistent.'
[t,x] = ode45(@Task6,[0 10],[1;0;1;0]) %proper function call ode45 or ode23 solves without any problem % Time span ---^-...

7 years ago | 1

| accepted

Answered
How to publish all large matrix answers in pdf form so that each value are displayed?
publish('myscript.m') %where myscript is the name of your file

7 years ago | 1

Answered
for loop does not iterate and store data
length(NumberofSimulation) is one because it's a scalar not a vector nor a matrix thats why your for loop iterates once for kk=...

7 years ago | 0

| accepted

Answered
Sorting cell array containing alphanumeric text
sort(a) where a is your cell array

7 years ago | 0

| accepted

Answered
Remove same element from vector
E=[1,2;1,3;1,6;2,3;2,4;3,7;4,5;5,6;5,7;6,7;1,2;2,4;6,8]; [E,~,~]=unique(E,'rows'); idx=ismember(E,[6 8],'rows'); E=E(~idx,:) ...

7 years ago | 0

Answered
How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h
"How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h" V=4; R=3; h = height(V,R) %...

7 years ago | 0

| accepted

Answered
computing finite time grammian
https://www.mathworks.com/matlabcentral/answers/286516-integral-of-controllability-gramian#answer_224073

7 years ago | 1

| accepted

Answered
if |x-10|=10 , what will be the value of x? how to present this mod in matlab ?
EDITED syms x real solve(abs(x-10)==10,x) command window: ans = 0 20 >>

7 years ago | 0

| accepted

Answered
how to give param value
EDITED Read https://www.mathworks.com/help/matlab/math/parameterizing-functions.html to better understand x=-10; y=-6; z=0; ...

7 years ago | 0

Answered
I keep getting errors when trying to use the ode 45 function to integrate an acceleration equation to determine vO vs. t, transferring all constants to the function using global variables.
clc clear f=3500; cd=.6; cf=3; m0=600; c=2; d=0; dN=0; for t=0:0.1:5 vE=0; m=m0-(c*t); n=0; v=0; ...

7 years ago | 0

| accepted

Answered
Live Editor doesn't saving
It might happen if the script is running , so press control+c (windows) or command+c(mac) in command window and then start the l...

7 years ago | 0

Answered
how to read records line by line saved in m30.txt .
Edited Do you mean this? fid=fopen('m30.txt','r') f=textscan(fid,'%s','Delimiter','\n') fclose(fid) celldisp(f)

7 years ago | 0

Answered
How to make the sum of all elements?
The result is not the same because you are summing up a scalar in each iteration thats why example sum(5) ->5 so the one which...

7 years ago | 0

| accepted

Answered
sorting the values of a vector into a new one by its elements size
Simple and easy solution: xnew=sort([x y])

7 years ago | 1

Answered
How can I import a csv with unknown dimension?
https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html follow the instructions in the link use a c...

7 years ago | 0

Answered
I will get 400 values of k using the following code. How can I add each value of k and display the result?
k=cell(399,7); %preallocation for i=1:399 for j=1:7 k{i,j}=A(i).*Z(i,j); end end celldisp(k)

7 years ago | 0

Answered
Projectile 2D plot with drag using ODE45
https://www.mathworks.com/matlabcentral/answers/15119-use-of-ode45-for-projectile-trajectory-including-drag#answer_20524

7 years ago | 0

Answered
how to compress and delete the same values in vector?
>> A=[1,2,3,3,3,4,5,6,6,7,7,8,9]; Awant=unique(A) B=[1,2,3,3,3,4,4,5,5,6,6,7,8,9]; [~,c,~]=unique(B,'last'); B1=...

7 years ago | 2

| accepted

Answered
It's a bug?
It‘s called floating point comparison just search with the tag floating-point in this forum you will find lot of reasons abs(al...

7 years ago | 0

| accepted

Answered
How can I label a vector?
x(1:5)=1; % where x is your random vector x(end-4:end)=0;

7 years ago | 0

Answered
how can we do this?
[value,index]=max(vector) %use max which does exactly what you want

7 years ago | 1

| accepted

Answered
Generate all possible combinations
A = [1;2] B = [3;4] C = [5;6] D = [7;8] E=nchoosek([A(:); B(:) ;C(:); D(:)],4)

7 years ago | 1

Answered
How to open cell array in excel?
I think you mean from excel file - then use readtable() to read the file celldisp() to view the contents of each cell

7 years ago | 0

Answered
How to plot some plots with error bar in one figure?
x = 0:0.5:2*pi; err1 = x/30; err2 = x/30; y1 = sin (x); y2 = cos (x); errorbar(y1,err1) hold on errorbar(y2,err2) ...

7 years ago | 1

| accepted

Load more