Answered
How can I sort the filenames in order given by dir()? I cannot turn a structure into a character array which means I cannot use sort, any tiips?
Hi, You'd need to use this syntax for char() command: h = char(File_names.name); With this, the command sort() sorts out the...

7 years ago | 0

Answered
Remove gravity factor from accelerometer
Hi, In your case, to reduce noise influence from your acceleration measurements with accelerometers you would need to employ ...

7 years ago | 0

| accepted

Answered
How to change the background colour of this image to 0 and foreground colour to 1 to make it binary.
Hi, Here is a short code that reads and separates the three layers of colors: AA = imread('Matrix.png'); R=AA(:,:,1); G=AA...

7 years ago | 0

Answered
Compare the entire elements of matrix with a number
Hi, Here is the one of the possible solutions: e=0.005; n=1:1000; H=(n-1)*e; A=[1 2 3; 3 4 5; 7 10 15]; for ii=1:100...

7 years ago | 0

Answered
Creating an algorithm to average large data sets with numerical and non-numerical data?
Hi, Simple solution is to use isnan() to find out empty cells and set their values equal to 0, e.g.: A = xlsread('MY_data.xl...

7 years ago | 0

Answered
How can an equation be obtained using four series of data?
Hi, Here is the way how to create equations from your data: ABCD=[5/78824 88/7762 19/878 0/889028; 6/00752 70/5228 23...

7 years ago | 0

Answered
how to store a vector that i got from a for loop ?
Hi, Here is the solution to your loop based script to save all values: for i=1:3 a(i, :)=[2+i,i] d(i, :)=[5+2*i, 3*i] e...

7 years ago | 1

| accepted

Answered
How to save simulink model together with inputs given in matlab file?
Hi, Input arguments/variable values can be inserted within your simulink model in your case via Callbacks that can be accessed...

7 years ago | 1

| accepted

Answered
How can I make 3D imagesc figure?
meshc() can be employed to plot with the given x, y, z data.

7 years ago | 0

Answered
How to make a particular folder open in matlab for saving images?
In this case, to change directory with cd() command might be helpful to change the currrent directory to the directory where you...

7 years ago | 0

| accepted

Answered
How to run through many variables at a different set of times continuously?
Probably, you can employ for loop (ii = 1:200) then combine/concatenate all evaloved values into separate variable(s). e.g. ...

7 years ago | 0

Answered
Problem plotting two parametric equations
Hi, Here is the fixed code: w=linspace(0,1); mu= 0.1*w+0.14*(1-w); sigma = (0.12^2)*w.^2+0.4*0.12*0.2*2*w.*(1-w)+(0.2^2)*(...

7 years ago | 0

| accepted

Answered
takes time importing large data files
Hi, There are several builtin options/functions in MATLAB to get the data imported faster than import wizard or importdata()....

7 years ago | 0

Answered
How do i model differential equations in simulink that are not time dependent ?
Hi, Yes, it is possible to solve this type of ODEs in SImulink. Here is the solution model attached. Note that the simulati...

7 years ago | 1

Answered
How can I solve for coupled differential equations?
if FREQ = 0 ... 1000 Hz. Then you will have 1001 solutions with a freq step of 1 Hz. e.g. f = 0:1000; F = 5* 5 * (1i * 2 * pi...

7 years ago | 1

Answered
probleme with binarization my image
Hi, Here is a simple solution: clearvars DD=imread('image.bmp'); figure(1), imshow(DD), title('Original') M...

7 years ago | 0

Answered
How can I use Lorenz Attractor code?
Hi, You were not executing the codes properly. Here is a single code that associates both scripts into one. Now it is much si...

7 years ago | 3

Answered
How can I use Lorenz Attractor code?
Hi Darwin, Here is my version of the Lorenz Atractor simulation code: function df = LORENZ_sys_1ODE(~, x) % HELP: Lorenz F...

7 years ago | 0

Answered
Simout and solver step time
Hi Daniel, Your chosen time step 0.01 is showed up in your right zoomed in plot that is correct and can't be ideal step functio...

7 years ago | 0

Answered
How to apply 2D hanning window to an image
Maybe this source would be helpful for you: https://www.mathworks.com/matlabcentral/answers/265430-ifft-of-a-hanning-windowed-ff...

7 years ago | 0

| accepted

Answered
How can I plot segmented data with time?
if you want to use the whole time space of yours, e.g. 0 ... 40 s then you can use a linear interpalation, i.e. interp1. Good l...

7 years ago | 0

Answered
How to split data from being in one excel file cell into multiple column
Ahmed, Could you please post your sample data in Excel file to test and provide a solution to your problem?

7 years ago | 0

Answered
An error message using fmincon
Hi Ektor, You have done a good work except for two small flaws, but crucial ones. Here are the corrected scripts: function [...

7 years ago | 0

| accepted

Answered
How do I make this for loop
Hi Nanny, Here is the loop based code of your problem: point = [105,308 162,470 200,150 ...

7 years ago | 0

Answered
Speaking the time in my code or codes
Hi, If I have understood your question correctly, here is the corrected code that speaks the current time: NET.addAssemb...

7 years ago | 0

| accepted

Answered
I'm trying to solve a quadratic equation by varying a variable multiple times
Hi, Here is the corrected code: % Since you are trying to solve your system symbolically then you'd need to % assign symbo...

7 years ago | 1

| accepted

Answered
Optimizing minimization with fmincon function
Hi, By setting up the solver algorithm in the option settings, the simulation time cna be shortened substantially. E.g. g=ra...

7 years ago | 0

| accepted

Answered
Tune controller by using pidtune() with output disturbance instead of input disturbance
Hi Robert, In this case, I would suggest to take out your controller C from your system model and add it from the outside as ...

7 years ago | 0

Answered
Reading/writing in data from set of text files in loop
Hi Thomas, yes, it is feasible and your import code with loop would be of this format, e.g. your data *.txt files called 1.tx...

7 years ago | 0

Answered
Input functions and using lsim for sin input???
Here is the fixed code: R = 4700; C = 47*10^-9; w = 2*pi*100; dt = 1e-5; % Smaller sampling time is needed t1 =...

7 years ago | 0

Load more