Answered
convert time to frequency domain
Hi, You would need to read/import your time domain data in MATLAB and then perform Fourier Transform (undertand from the good...

7 years ago | 0

Answered
Differential equations model it does not work
Hi, There are a couple of minor (but essential) flaws, such as x(1) used (presumably) instead of y(1) in V1 and V2. Anyhow, t...

7 years ago | 0

Answered
runge kutta method 4th order
Hi, There are several flaws and unclear issues in your script: (1) What is your given system of ODEs with x,y,z variables? ...

7 years ago | 0

Answered
How to ensure my times will follow daylight savings?
Hi, UTC is a good approach and your code seems to be considering all possible case scenarios w.r.t time zones with your emplo...

7 years ago | 0

Answered
Fit file image not correct
Hi, Maybe in your case this syntax will resolve the problem: >>DATA =fitsread(FILENAME, NAME, VALUE) Good luck

7 years ago | 0

| accepted

Answered
bar function doesn't function
Use: >> clear all and run again: >> bar([1 2 3]) Nothing happens, then just close MATLAB and restart it. Maybe these steps wo...

7 years ago | 0

Answered
How To change this C++ code to matlab code ?
Hi, You should have a compiler installed in your pc. if you have a compiler, the coversion is quite simple: Run: >> mex MYfi...

7 years ago | 0

| accepted

Answered
Problem with simple Genetic Algorithm Optimisation
Hi, In your MAIN file, you have set UB = [200 10]; that need to be fixed at UB = [75, 10]. Good luck.

7 years ago | 0

Answered
simulink workspace transfert function
Hi, If you are using linearization as demonstrated in the video and wish to see/save a State-Space respresentation of the tra...

7 years ago | 0

Answered
Trouble in code with error "index exceeds number of elements"
Hi, In your code, k=1:length(y) has to be k=1:length(y)-1. Because you are trying to access y(k+1) when you have the length o...

7 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
Hi, Indeed, the indices in your case (x) have to be integers, like, 1,2,3,... can NOT be 0, -1, -2, 1.2, 2.5, etc. Index ind...

7 years ago | 0

Answered
Saving all output of for loop
Hi, Simply add (i) after your output variables, viz. X1, Y1, X2, Y2: for i=1:1500 X1(i)=J(i)-sqrt((D(i)^2)/((sqrt(A(i))+1)...

7 years ago | 0

| accepted

Answered
Help with entry for Dirac delta function...
Hi, Here is a simple and short code to your problem: % Given system's transfer function: SYS=tf([-67500,-3*10^9,-654*10^9]...

7 years ago | 0

| accepted

Answered
Convert scalar values into date time and viceversa
Hi, It is possible and here is the command syntax: DateStr = '12-May-2019'; FormatIn = 'dd-mmm-yyyy'; Today = datenum(Date...

7 years ago | 0

Answered
Solving a system of nonlinear equations
Hi, Here is the solution to your problem in which C is taken to have values C = 1:10 that can have any values. clearvars; cl...

7 years ago | 0

Answered
Can grid rotate?
What is the purpose of rotating grids in your plot figure? Maybe you don't need to rotate grid but to rotate your plot data by 4...

7 years ago | 0

Answered
How to choose sampling frequency
What is your objective: copying somebody's answer to your previous question and posting again with another question?

7 years ago | 0

Answered
project on signals frequencies
Hi, Here is one of the possible ways to generate your signals: N = 1e3; % Number of data points T0 = pi; % Can be any n...

7 years ago | 0

| accepted

Answered
Search a matrix combined with logical indexing
Hi, Here is a quick and a bit crude way of solving this or similar issues: clearvars A = [3 10 2 5; 2 14 5 3]; Anew = [A(...

7 years ago | 0

Answered
Modification of rectangle plot
Change the ordering of x(ii)'s and x(ii+1)'s. Good luck.

7 years ago | 0

Answered
How to find same values in table and show them in a new table?
One of the possible ways is to write a small function file with fgetl(), ischar(), strfind(), etc., like this one. This can sear...

7 years ago | 0

Answered
Passing a function as an argument when the function itself has been passed
Now you can verify this with any function.

7 years ago | 0

Answered
Passing a function as an argument when the function itself has been passed
You are using a wrong command what I have proposed. The correct way of calling the anounymous function in my proposed solution i...

7 years ago | 0

Answered
Passing a function as an argument when the function itself has been passed
If I have undertood your problem correctly, what you are trying to do is g(h(f(x))), right?! In other words, to pass f(x) into ...

7 years ago | 0

Answered
Could not save my variable in a specific name
Two very tiny flaws (e.g.: unnecessary "." and necessary ' ') in your used syntax and here is the correct syntax: filename=['sy...

7 years ago | 0

| accepted

Answered
How to create a for loop through a directory for only certain folders in the directory
In this case, path() should be the option to employ in order to have access to subfolders. oldpath = path; path('..\Sample\sub...

7 years ago | 0

Answered
view or insert files into directory ?
You can start with: cd(' ') % change the directory open(' ') % to open .m, .mat, .slx, .mdl files

7 years ago | 0

Answered
Modification of rectangle plot
Here is the code the colors the plot values w.r.t y values: clearvars; clc; close all x = [3 3 2 3 2 3 2 3 2 3 4 3 4 3 2 3 2 3...

7 years ago | 0

Answered
Using Euler's method in MatLab to solve a system of ODEs
You can express your system of ODEs directly (1), using anonymous function (@) (2), writing a function file (3) or inline functi...

7 years ago | 0

Answered
Loop through CSV (or XLS), compare values in rows and create new Cell Array based on results
Here is the MATLAB generated function file attached (IM_data.m) that creates categorical cell array data. You can generate this ...

7 years ago | 0

Load more