Answered
how do make the integral a vector
integral=cell(1,n); integral{1}=0; for i = 2:n r_left = (a+(i-1)*h); r_right = (a+i*h); % Fun...

7 years ago | 0

Answered
Can't figure out why I'm getting an error
A=yourmatrix; [U, S, V] = svddecomp(A) %function calling function [U, S, V] = svddecomp(A) % AV = UΣ method dimA = si...

7 years ago | 0

Answered
Hi, I have problem with convolution. The script doesnt work on mine.
see conv x = [3 11 7 0 -1 4 2]; nx = -3:3; %edited after Guillaume‘s comment h = [2 3 0 -5 2 1]; nh = -1:4; C=conv(x,h) %co...

7 years ago | 0

| accepted

Answered
matlab ode45 out of memory
tf = 72; % h h0 = 2; % m % Solve the DAE opts = odeset('Reltol',1e-5); [t,h] = ode45(@tankf1,[0 tf],h0,opts); % Plot the...

7 years ago | 0

Answered
How do I save data to a file in Matlab?
dlmwrite('sample.txt',[a,b,c],'delimiter','\t') %a,b and c are variables

7 years ago | 0

Answered
Plot graph on matlab
syms x y=(exp(x)/sin(x))+0.3 fplot(y,[-10 10])

7 years ago | 0

| accepted

Answered
Cube root of a complex function
syms Z ROOTS=solve(Z^3 == -8-3i,Z) logical(sum(ROOTS)==0)

7 years ago | 0

| accepted

Answered
How do I insert a variable text string in matlab plot?
see https://www.mathworks.com/help/matlab/ref/texlabel.html t=text(0.2, 21, ['d = ' num2str(d_close)]); t.FontSize = 34; Vi...

7 years ago | 0

| accepted

Answered
Error using symengine, Too many input arguments
syms Tr P_r P_r phi f=@(phi,P_r) P_r - 8*Tr/(8*phi-1) +27/(64*phi^2); dp_dphi=diff(sym(f)); dp_dphi=matlabFunction(dp_dphi);...

7 years ago | 0

Answered
how to build this code on matlab?
Edited (15*cosd(30)+2-4)*(120*sind(60))+(4+sind(30))*(120*cosd(60))

7 years ago | 0

| accepted

Answered
How to put a color in a this graph? (code)
C=[500 600 750.6 800 400.7 350 500.4 487.3 125.6 258.6 158.3 147.6] R=3; R2=2; for i=1:2 for j=1:6 t=linspac...

7 years ago | 0

Answered
How to import data with string, missing data,and numeric values?
fid=fopen('Example_of_input3.txt'); f=textscan(fid,'%s', 'delimiter','\n'); fclose(fid); celldisp(f)

7 years ago | 0

| accepted

Answered
Why does my script keep getting the Error using ./ Matrix dimensions must agree when calculating y in the script
clear g=9.81; %value for gravity v=30 y0=10 theta=10; [d,t,y_max] = fire_projectile(v,y0,theta); x=0:1:65; y = (x.*tan(th...

7 years ago | 1

| accepted

Answered
How to plot magnitude and phase spectra of a square wave in matlab ?. Please help ,I am new to matlab. Thanks in advance
https://www.mathworks.com/matlabcentral/fileexchange/19038-square-wave-fourier-series-demo?s_tid=answers_rc2-1_p4_MLT

7 years ago | 0

Answered
Why does this not install.
https://www.mathworks.com/matlabcentral/answers/314517-the-application-could-not-connect-to-mathworks-on-matlab-start#answer_245...

7 years ago | 0

Answered
How to store data in a nested for loop?
A=cell(12,10); %pre-allocation for speed and efficiency B=cell(12,10); C=cell(12,10); D=cell(12,10); for J = 1:12 for ...

7 years ago | 0

| accepted

Answered
Livescript does not function properly
https://www.mathworks.com/matlabcentral/answers/362937-unable-to-run-a-live-script#answer_287896

7 years ago | 0

Answered
How to find a raw and column number of an element in a matrix?
my code m=[ 1 2; 3 4; 5 6; 7 8] [r,c]=find(m==3) your code you are trying to find the index of the number by itself which is...

7 years ago | 1

| accepted

Answered
I can´t save live editor scripts
if you have .m file with the same name you cant save live editor with the same name rename and then save your file as .mlx

7 years ago | 0

Answered
Can't use a second function inside the main one
number = sub; invert = func(number); disp(invert); your code func; -> which needs an input here , this line was superfluos ...

7 years ago | 1

Answered
How to replace numbers in an array
A = [0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3] A(A==0)=NaN; B=fillmissing(A,'NEXT') command window: >> COMMUNITY A = ...

7 years ago | 0

Answered
How do I make the same output using the fprintf() command instead of disp()?
Replace disp with: fprintf('A(%d,%d)=%d\n',i,j,A(i,j))

7 years ago | 1

| accepted

Answered
color distribution in L*a*b*
a(a<0) a(a>0)

7 years ago | 0

Answered
Why am I getting an error code saying my X and Y vectors are not the same length?
for i = 1:length(east) scatter(east(:,i),north(:,i),sz,color) hold on end

7 years ago | 0

| accepted

Answered
How do I plot the first 200 points of each vector on the same graph?
plot(t(1:200),y(1:200))

7 years ago | 0

| accepted

Answered
I am not able to troubleshoot licensing error:-8,523
https://www.mathworks.com/matlabcentral/answers/100496-why-do-i-receive-license-manager-error-8#answer_109844

7 years ago | 0

Answered
Opening a simulink file that was saved in R2018b version onto a R2017b version.
https://www.mathworks.com/matlabcentral/answers/94724-how-can-i-open-my-current-simulink-models-in-previous-versions-of-simulink...

7 years ago | 0

Answered
Index in position 2 exceeds array bounds
Just try upgrading to 2018b and see if it works , so it might be the solution then. Also make sure ../Experimental_Data/DBDA_Pr...

7 years ago | 0

| accepted

Answered
ODE45 arguments not working
%% [t2, v]=ode45(@ODE4590kg,[0:0.1:300],[0,0]); %Line 85 %FUNCTION CALLING BEFORE FUNCTION DEFINITION xx2_prime = v(:,1); ...

7 years ago | 0

| accepted

Load more