Answered
Given time series and sample frequency, how do i conduct Fourier transform onto this time series and determine amplitude, frequency and phase?
If you have a signal that is sampled at regular time intervals, then use fft and see the first example there for the code to fig...

3 years ago | 0

Answered
What is the MATLAB code for Modified Duobinary coder without a pre-coder?
There is no function provided in MATLAB or any of the toolboxes for that purpose. You will need to write the code yourself, or...

3 years ago | 0

Answered
I want to ask if it is possible to add these two horizontal matrices and if so, how?
No, it is not possible. The first one is 5 x 3 and the second is 10 x 1. You can extract the first 5 rows of S and add that to...

3 years ago | 0

Answered
Extracting numbers including 0 at the start of the number
The way numbers like 02290234567 are stored internally is as IEEE 754 Binary Double Precision. It is a base 2 representation, an...

3 years ago | 1

Answered
Trying to fix output from matlab code for derivative
remove df = [NaN NaN derivative NaN NaN]; but leave the assignment of nan to df Now offset = floor((numel(f) -...

3 years ago | 0

Answered
save 3D figure obtained with 'findobj'
savefit(fig_4, fullfile(destdirectory_FIG, 'name_of_FIG.fig'))

3 years ago | 0

Answered
Reference to non-existent field when opening gui with toolbar icone
If you have created a gui using GUIDE then you must run the m file not open the fig file. The handles structure does not get cre...

3 years ago | 0

Answered
Double integral with variable limit with integrand as an numerical array
Use integral2(). The first set of bounds must be numeric, but the second set of bounds can be function handles.

3 years ago | 0

Answered
How to give colorbar to a tif image in Matlab
If the tif is rgb then there is no meaningful colorbar for it. If the tif is not rgb then imshow would have automatically use...

3 years ago | 0

Answered
parfor with temporary variable worning
temp_info is assigned to inside the parfor in a way that is not indexed by the loop variable. parfor automatically makes it a te...

3 years ago | 0

Answered
Plotting a 2d graph
a = randi([1 5]) b = randi([1 5]) c = randi([3 10]) syms x y fimplicit( a*x^2 + b*y^2 == c ); axis equal

3 years ago | 0

| accepted

Answered
Error using autoclave function
%% clear memory, screen, and close all figures clear, clc, close all; %% Process equation x[k] = sys(k, x[k-1], u[k]);% untuk ...

3 years ago | 0

| accepted

Answered
How to solve error in particle filter code
nx = 6; % number of states %... ny = 1; % number of observations %... x = zeros(n...

3 years ago | 0

Answered
I am struggling to plot iteration vs error in the matlab code? can anyone help me with this? very much appreciate it.
fprintf('\n Iteration %d: Relative error = %g\n', N, rel_error);

3 years ago | 0

Answered
Error in the script
A/B is approximately A*pinv(B) where the * is inner product (algebraic matrix multiplication). When both sides are column vector...

3 years ago | 0

| accepted

Answered
How to create a matlab script of an already created .slx file?
No, there is no way to convert a Simulink or Simscape or Stateflow model to the corresponding MATLAB code. And if there were the...

3 years ago | 0

Answered
How can I read Serial Data?
readline() and sscanf() using 'A%dB%dC' format

3 years ago | 0

Answered
How can I make a string array consisting of strings with numerical suffixes?
compose("sub%02d",1:50).'

3 years ago | 1

Answered
Find the some of a row with numbers greater than -1 in matlab
B = [103, 61, 0, 0, 62, -999, -999, 0, 0, 2] sum( max(B, 0), 2)

3 years ago | 1

| accepted

Answered
How to do piecewise linear approximation from x and y points?
A piecewise linear approximation could have a piecewise break at or between any pair of points, and is therefore not unique. You...

3 years ago | 0

Answered
Command Window output weird on Mac OS
I suspect that Preferences -> Fonts, Desktop Code Font has been set to a non-monospaced font.

3 years ago | 0

| accepted

Answered
Constrained Particle Swarm Optimization
https://www.mathworks.com/matlabcentral/fileexchange/25986-constrained-particle-swarm-optimization You would need to use a non...

3 years ago | 0

| accepted

Answered
Extract points from generated mesh
e2 = antenna.Ellipse('Majoraxis',4,'Minoraxis',2) h = mesh(e2,'MaxEdgeLength',1e-1) xyz = e2.Points .'; These are the point...

3 years ago | 1

| accepted

Answered
Is there a one line implementation for this?
syms t; M = [sin(t), cos(t); tan(t), t]; result = arrayfun(@(I,J) double(subs(M(I,J), t, 1:10)), [1 1; 2 2], [1 2; 1 2], 'unifor...

3 years ago | 0

Answered
DIsplay numbers in an expression in scientific notation
syms L1 L2 C1 C2 C3 Rl s; L1=10e-9; L2=500e-12; C1=600E-12; C2=2E-9; C3=100E-12; Rl=2; H_P_V2DivI1 = (C2*Rl*s + 1)/(C1*C2...

3 years ago | 0

| accepted

Answered
Why the mod function does not work
angstn =mod(atan2(norm(det([P2-P0;P1-P0])),dot(P2-P0,P1-P0)),2*pi); norm() is always non-negative, so you are taking atan2(...

3 years ago | 0

Answered
How to horizontally merge cells of strings/chars for each row without writing a for-loop?
fmt = repmat('%s', 1, size(YourCell,2)); output = compose(fmt, string(YourCell));

3 years ago | 0

| accepted

Answered
Directed random wandering.
Consider that when you move from 0 to 50, you need to take 50 "unbalanced" steps -- 50 steps that are +1 and for which there are...

3 years ago | 0

| accepted

Answered
Store for loop data in cell array
years = 2000:2005; months = 1 : 12; num_years = length(years); num_months = length(months); monthly_average_cell = cell(nu...

3 years ago | 0

| accepted

Answered
HOW CAN I PLOT THE SUM OF A LOOP AGAINST TIME TO HAVE SIX LINES OF SOLUTION ON THE GRAPH
Your third variable, x2, is the only one that is length 6, so I had to guess that you wanted the sum of all the entries for each...

3 years ago | 0

Load more