Answered
Integration containing multiple variable and plotting
Use integral3: https://www.mathworks.com/help/matlab/ref/integral3.html

2 months ago | 0

Answered
cannot add path on mac
Maybe in mac, this way works: addpath(genpath('/Users/maherheal/Applications/CPLEX_Studio128/cplex/matlab'))

2 months ago | 0

Answered
Protect Matlab/Simulink Files
One option is creating p-code of m-files, e.g.: >> pcode MYfile.m

2 months ago | 0

Answered
Projectile Motion With Air Resistance Vs. Free-Falling with Air Resistance
You can add the free fall plot using simply, e.g.: ... xfall=x(1)*ones(size(x)); yfall = linspace(0, h, numel(y)); plot(xfal...

2 months ago | 1

| accepted

Answered
why looping just save the last value of iteration
Because the indexes are missing, e.g.: data_diff(??) = out.Vo.signals.values-v_data; lse(??) = lse(??) + (data_diff'*data_diff...

2 months ago | 0

Answered
Startup view for a Simulink model.
See the attached example.

2 months ago | 0

Answered
Startup view for a Simulink model.
Hi, Hit your highest level system model on the left top corner of the model browser and then save your model. That would give...

2 months ago | 0

| accepted

Answered
for loop forward modelling
You can start working somewhat in this way: ... rho = 2600; % Note density can't be negative. for ii = 1:2 f...

3 months ago | 0

Answered
3D Plotting with symbolic variables
If it is a symbolic expression, use fmesh(). Here is a good doc how to employ it: https://www.mathworks.com/help/matlab/ref/fmes...

3 months ago | 0

Answered
Script too Long to Run
Here is a little simplified version of your code: clc format long n=1e4; x1=zeros(n,1); x2=x1; x3=x1; x4=x1; error=x1; ...

3 months ago | 1

| accepted

Answered
How to fill the area between two curves?
Here are a couple of good examples how to achieve this task: https://www.mathworks.com/matlabcentral/answers/180829-shade-area-...

3 months ago | 0

Answered
Rearrange a given array
A = [1 2 3 4 5 6 7 8 9 10 11 12]; B = sort(A(:), 'descend'); C= reshape(B, 3,4)...

3 months ago | 1

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...

3 months ago | 0

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

3 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...

3 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...

3 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)=...

3 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...

3 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...

3 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 ...

3 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) ...

4 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...

4 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...

4 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; ...

4 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...

4 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...

4 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...

4 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...

4 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...

4 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'); ...

4 months ago | 0

| accepted

Load more