Answered
How to change printing options
print(gcf,'figure.pdf','-fillpage')

7 years ago | 0

Answered
whats the error in the surface plot? How to correct it?
Use dots after * and / (element wise operation): [x y]=meshgrid(13:120,1:12); igx1=((x.*y.^3)/12)+(x.*y).*((((x.*y).*(150-(y./...

7 years ago | 0

| accepted

Answered
What is the best way to run a python script from my MATLAB script?
system('example.py')

7 years ago | 0

Answered
Extract a row as a function of a variable
T=linspace(0,5,numel(xx(1,:))); y=T.^2+sin(P+xx(1,:)); plot(T,y)

7 years ago | 1

| accepted

Answered
Homework help - need help debugging it
Use logical index instead of if and elseif: x = [1 2 3 4 5 6 7 8 9 10]; y = [0.841 0.909 0.141 -0.756 -0.958 -0.279 0.656 0.98...

7 years ago | 1

| accepted

Answered
how can I get data from a excell table that varies each 2 seconds?
readtable()? does it help?

7 years ago | 0

Answered
referencing a matrix value to another matrix value within the same matrix
A = [1 2 3]; A = [ 1 2 3 A(1,1)]; % to perform A(1,1) it has to be defined before using

7 years ago | 0

| accepted

Answered
Help debugging my program for plotting ezplot of sin and cos
x=0:1:pi; a=@(x) sin(pi*x); y=@(x) cos(4*pi*x); ezplot(a,[0,2]); % you forgot to add [ ] brackets hold on; ezplot(y,[0,2...

7 years ago | 1

| accepted

Answered
How can I get a set of varying length array?
sir Image Analyst is right , anyhow the pattern your looking for is not discernible but however... Just change P according to y...

7 years ago | 0

Answered
How to solve system of 2nd order differential equations using ode45
Here you go! syms x(t) y(t) z(t) %Clohessy-Wiltshire Equations % d2x = 2*n*dy + 3*(n^2)*x; % d2y = -2*n*dx; % d2z = (-n^2)*...

7 years ago | 5

| accepted

Answered
How to plot a circle 3D surface area, using surf or mesh?
Perhaps see sphere() ? it gives a volumetric object though

7 years ago | 0

Answered
Error using fsolve, indices not compatible
Alternatively a script can contain function at the end of your script in 2016b or later r = 3; f = 2; x0 = 0; x1 = -3; x2 =...

7 years ago | 0

| accepted

Answered
How to skip [] when add values to a vector variable?
% Just alter the below lines in your code points=cell(1,n); % before loop points{i}=values; %inside loop cell2mat(points) %ou...

7 years ago | 0

Answered
Why does 7*(0.1) - 0.7 = 1.1102e-16 whereas 9*(0.1)-0.9 =0 in MATLAB?
https://www.mathworks.com/matlabcentral/answers/428577-very-odd-error-with-simple-multiplication-ok-not-so-odd#answer_345716

7 years ago | 1

Answered
Averaging columns from multiple excel files
Processing sequence of files

7 years ago | 0

| accepted

Answered
How to calculate the memory required by struct, numerical and char arrays? Kindly share the formula?
>> L1=[84.5,91.0,98.0,80.5,99.0,100.0,88.0] %numerical array version L1 = 84.5000 91.0000 98.0000 80.5000 99....

7 years ago | 0

| accepted

Answered
matlab ode45 wont accept new parameter
EDITED If you want to pass a new parameter to a function parametrize your function % Set extra parameters tf = 72; % h h0 = ...

7 years ago | 0

Answered
Is there any function in MATLAB, which would round the values to nearest big integers?
Yes use round() inputs=[2598 2499 2399 2299 2199 2099 1999 1898 ...

7 years ago | 1

| accepted

Answered
Square wave with values 0 to 1 rather than -1 to 1
t = linspace(0,1).'; x = square(t);

7 years ago | 0

Answered
Vector equation with two unknowns
Read about solve() and vpasolve() syms V W [V,W]=solve([ -1 0 0 ]*V == [ 0 -1/3 0 ] + [ -4 4 0 ]*W,V,W) Command window: >> ...

7 years ago | 1

| accepted

Answered
How to reverse a vector
A.'

7 years ago | 1

Answered
How to plot Euler's method and ODE45 against eachother?
a=[T(:) N(:)]

7 years ago | 1

| accepted

Answered
How to write a function to calculate ODE?
Start by reading this documentation page

7 years ago | 0

Answered
extracting the nth multiple rows of a large matrix to create a submatrix
Simpler and easier: x = a(5:5:end,:) % edited after all the comments

7 years ago | 0

Answered
Why doesn't my code for Euler's method work?
correct usage is as shown below: N0=1; r=0.1; tmax=10; dt=0.1; [T,N]=expgrowthEULER(N0,tmax,dt,r) ; %function call plot(...

7 years ago | 1

| accepted

Answered
I'd like to create a loop that each create a new .txt file.
https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html use dlmwrite to write text files and sprint...

7 years ago | 0

| accepted

Answered
how do i save the contentes of a function with out save?
escreve(mtx, assigment, cost); % assuming the input arguments are already defined function escreve(matriz, assignmen...

7 years ago | 0

| accepted

Answered
Find a specific element in a specific column in an excel sheet
T=readtable('PeriodicTableElements.xlsx'); str=input('Enter symbol : ','s'); % enter H for testing TT=table2cell(T); idx=strc...

7 years ago | 1

| accepted

Answered
Undefined function or variable 'audioDatastore'.
https://www.mathworks.com/help/audio/ref/audiodatastore.html - introduced in 2018b

7 years ago | 1

| accepted

Answered
assigning value to a changing struct field
gear_ytpe={'P', 'G'}; axis={'x' ,'y' ,'z'}; for ii=1:2 for jj=1:3 statistics.Envelop.CF.gear_ytpe{ii}.Diff.axis{jj}...

7 years ago | 0

Load more