Answered
Plot symbolic function and non symbolic functions on the same plot?
Here is a simple example: figure fplot(@(x) sin(x), [-pi, pi]) hold on x = linspace(-pi, pi, 25); plot(x, sin(x), 'rd') le...

2 months ago | 0

Answered
How to use imwrite with image object?
You can try this command, e.g.: imwrite(double(im),filename)

2 months ago | 0

Answered
Sharing MATlab codes (.m files)
Have you read this nice discussion on this subject written by Loren: https://blogs.mathworks.com/loren/2021/07/15/sharing-and-r...

2 months ago | 0

Answered
How do I smooth a curve on a surf plot?
You can try smoothdata() with Gaussian, e.g.: X = load('DFF_vals.mat'); Y = load('ZFF_vals.mat'); Z = load('Fin.mat'); Zsmoo...

2 months ago | 0

Answered
HELP: Index in position 2 is invalid. Array indices must be positive integers or logical values.
Your fcn file straighten.m that contains one crucial mistake, i.e.: The command in it on line 10 has a conflict: IM2(:,:,ct)=...

2 months ago | 0

Answered
How to create for loop for more than 1 file in path?
You exercise can be solved using a simple for loop, e.g.: G = ["C:\...\ANOVA.xlsx"; "C:\...\Data.xlsx"; "C:\...\DAT1...

2 months ago | 0

Answered
assigning element in 3D matrix
First of all, you need to close the loops with "end" in your code, i.e.: nz =3; nx=2; ny=3; Tz_D = zeros(nx,ny,nz); mobil...

2 months ago | 0

| accepted

Answered
How can I solve the italicized equation for the matrix gamma_e, gamma_s and d1 ?
By a quick glance, one sees that there are a couple of points to be fixed in the 2nd loop, i.e.: ... for didx1 = 1:num_d1 ...

2 months ago | 0

Answered
cosine estimate taylor series
Here is the corrected code: ang = '045-00-00'; k = 2; res = cosineEstimate(ang, k) function res = cosineEstimate(ang, k) ...

3 months ago | 0

Answered
Mass Spring System ode45 with multiple damping values
It is realtively easy to attain the issues of solving the exercises for all damping values and plot them all with appropriate le...

3 months ago | 0

| accepted

Answered
Arduino Support Package not installing after installation
Have you tried to hook up Arduino board to your computer via USB to see if your MATALB package shows up a message saying "Arduin...

3 months ago | 0

Answered
Signal generation on Simulink?
This modulation signal can be generated using the following Simulink model and/or this M-ffile: fs = 5000; ...

3 months ago | 0

Answered
Can you both exclude outliers from a fit and use robust weighting for the remaining data?
In your exercise, if it is known which part to include in the fit simulation and which part to exclude, then you can use just ap...

3 months ago | 1

Answered
Can MATLAB save the Profiler results table (Function Name, Calls, etc.) to a text file or a spreadsheet?
You can try this fcn - extracthmltext() to extract the data from html formatted file: https://www.mathworks.com/help/textanalyt...

3 months ago | 0

Answered
How to distinguish specific nodes in an undirected graph ?
Here one potential err in your code is logical (==). One can determine when the value of a variable goes to infinity with this f...

3 months ago | 0

Answered
Can MATLAB save the Profiler results table (Function Name, Calls, etc.) to a text file or a spreadsheet?
Yes, it can be done realtively easy with profsave(profile()), e.g.: profile on x = linspace(0, 1, 2e3); y = sin(2...

3 months ago | 0

Answered
Error when importing STL file into Matlab
If you want to create a geometry using some edge coordinates, then hit this help: doc geometryFromEdges % Explains via a good s...

3 months ago | 0

| accepted

Answered
How can I load all these images using a for loop
It can be achieved something like this one: for ii = 1:55 FN = strcat('VIV_frames\ezgif-frame-',num2str(ii), '.jpg'); ...

3 months ago | 0

| accepted

Answered
How do I make tick marks longer?
Use these, e.g.: plot(x, y); ax=gca; ax.TickLength = [0.05 0.05]; shg

3 months ago | 0

| accepted

Answered
Error when importing STL file into Matlab
You are missing one important part in your command, see e.g.: pdem = createpde(); % Missing GM = importGe...

3 months ago | 0

Answered
IIR Band Pass Filter Design for Signal Noise Cancellation
This is quite stratightforward issue. You can design a band-pass filter using the help given here: https://www.mathworks.com/hel...

3 months ago | 0

| accepted

Answered
Error when running run section
In general, executing the cell modes of scripts is more sensitive on syntax errors made in other sections sections of the code. ...

3 months ago | 0

| accepted

Answered
Optimization of transfer function
Hi, There are two realtively easy ways to obtain those parameters' estimate values. (1) Using system identification toolbox...

3 months ago | 0

Answered
how to substitute symbolic equation into symbolic equation, and to reorganize symbolic equations
There are a couple of points in the code to be corrected and then you can get an analytical solution expressed in terms of other...

4 months ago | 0

Answered
Is it possible to get multiple 0s from fzero?
In your exercise, ie. a polynomial, the first try is roots() and then fzero() with different intervals can be an option for real...

4 months ago | 0

| accepted

Answered
How to delete more than one point from data array in loop?
If understood your question and you want to delete specific data rows, then you had better step your code somewhat in this manne...

4 months ago | 1

Answered
Export certain cells of a structure into a table (.csv file)
One quick solution with your large data to separate them and write to an external file is the following in the example of two fi...

4 months ago | 0

Answered
how to plot this equation ?
Here you'd need to define the purpose of using GF. If you are aiming to select any randomly selected values of GF while comput...

4 months ago | 0

| accepted

Answered
Curve Fitting an equation
You can try using a rational polynomial fit in this exercise if the variable x is also present in the denominator.

4 months ago | 0

Answered
How to add a .png image to be published as a pdf output file
% Use a proper image read command: image(imread('https://www.mathworks.com/help/examples/matlab/win64/ReadandDisplayImageExampl...

4 months ago | 0

Load more