Answered
Hi guys,i am beginner at matlab.Can you help me with that?I have a problem which is not plotting my values.
It is best to take the plot call out of the loop, and save thevariables as vectors to plot later. Try this: Ea = 100; m = ...

7 years ago | 1

| accepted

Answered
Return X coordinate of a fft plot where 80% of the total area under the curve is achieved
Try this: t = linspace(0, 10, 150); % Create Data y = sin(2*pi*t*3) .* cos(2*pi*t*2) + 0.01...

7 years ago | 1

| accepted

Answered
error using bandpass and pspectrum function
The pspectrum function was released in R2017b. Depending on what you want to do, use the spectrogram (link) function or the the...

7 years ago | 0

| accepted

Answered
when I "str2num'110110111'" I received 110110111 as the answer
I’m not certain what you’re asking. Try this: format long g q = str2num('110110111') returns: q = 110110111 See th...

7 years ago | 0

Answered
How to find point of intersection ?
Try this: blue = [1 5; 1 5]; % [x1 x2; y1 y2] red = [1 5; 3 2]; % [x1 x2; y1 y2] ...

7 years ago | 0

| accepted

Answered
simple formula to remove rows with repeated values in N x 2 matrix
The uniquetol (link) function (introduced in R2015a) allows you to set a tolerance. Also, setdiff does not have a tolerance opt...

7 years ago | 0

| accepted

Answered
Not enough input arguments
You need to pass all the arguments to ‘eqs1’ in your fsolve call. Try this instead: result = fsolve(@(z)eqs1(z,r1,r2,TotalF...

7 years ago | 1

| accepted

Answered
Problem to plot the results of a differential equation solved with ode15s
Use a value for your initial condition that is near 0, not equal to 0: a0 = 1E-15; % Initial condition of alpha That produces...

7 years ago | 1

| accepted

Answered
change position of axes in plot3d?
If you want to show the grid and axes, use the: grid on command after the plot3 call.

7 years ago | 0

Answered
find the values ​​in the row and column of the matrix by using the loop
Your ‘y’ values are not unique for each ‘x’ value. If you want all the ‘y’ values for each ‘x’ value, this works: D = load(...

7 years ago | 0

Answered
How do I specify the cell array to indicate strings in double quotation?
Use the string (link) function: A{1,1} = 'Station Number' A{1,2} = 'Depth' A = string(A) producing: A = 1×2 cell a...

7 years ago | 0

| accepted

Answered
display a single (x, y)
I would simply do: figure plot(curve_x, curve_y, '-b') hold on plot(2.899, -3.677, 'r+') hold off grid That would plot t...

7 years ago | 0

Answered
why there is a small error in these simple calculations?
See the documentation on Floating-Point Numbers (link).

7 years ago | 0

Answered
how can I generate a random angle?
Try one of these: rangrad = 2*pi*rand; % Radians rangdeg = 360*rand; % Degrees Experi...

7 years ago | 1

| accepted

Answered
find first time where data crosses 1
I created ‘zci’ to do just that: zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); % Returns Approximate...

7 years ago | 0

Answered
How can I represent the mean in figure
You are taking the mean of each column of ‘f’, which is what the mean function does by default. Try this: m = f - mean(f) ...

7 years ago | 0

Answered
After using "FFT" getting NAN. Why?
‘... what is the reason of this outcome?’ You probably either have a NaN in your data, or an empty cell. Both will appear as...

7 years ago | 5

| accepted

Answered
New to MATLAB, question about num2str
Rather than concatenating the ‘clk’ vector into one string that will be difficult to read, consider using the datestr (link) fun...

7 years ago | 0

Answered
fill in between horizontal lines
Try this: Time = 0:200; Wetbulb = 0.005*(Time-100).^2 + rand(size(Time))*2 + 50; green=20+Time*0; yellow=28+Time*0; red=10...

7 years ago | 0

| accepted

Answered
AMD GPU implementation on a Dell Precision 7710
You cannot on an AMD GPU, unfortunately. As much as I like them (and Ryzen processors), AMD GPUs do not have CUDA capability. ...

7 years ago | 0

| accepted

Answered
How to determine dominant frequency of the signal (excel attached) using Fast Fourier Analysis on MatLab?
The Fourier transform is straightforward: [D,S] = xlsread('Data.xlsx'); time = D(:,1); strain = D(:,2); L = numel(time)...

7 years ago | 0

Answered
Help with error matrix dimensions must agree
Your matrices are (100 x 100), and ‘T’ is (1 x 53). If you instead create ‘T’ as: T = linspace(-8, B, 100); your code work...

7 years ago | 1

| accepted

Answered
Understanding the code snippet
By inspection, it generates an identity matrix with dimensions (num_labels x num_labels), then assigns the ‘y’ row of it to the ...

7 years ago | 0

Answered
How can i create arranged points by having coordinates?
One approach is to use the ndgrid (link) function: x=[1 2]; y=[1 2 3]; [a,b] = ndgrid(x, y); points = [a(:), b(:)] produci...

7 years ago | 1

| accepted

Answered
How to fix the digits for the summation?
See the documentation section on Floating-Point Numbers (link). You are most likely seeing the result of floating-point approxi...

7 years ago | 0

| accepted

Answered
Plot data from two columns in csv
The ‘\n’ is a linefeed character. Consider using the readtable (link) function (R2013b and later), rather than dlmread for it...

7 years ago | 0

Answered
How to Solve Non-Linear Equation with changing coefficient
Try this: gama = 1.4; Athroat = 650; Area = [1000 650 800 900 1200]; machfcn = @(mach,area) (1./mach).*((2*(1+((gama-1)/...

7 years ago | 0

| accepted

Answered
How to save in n different variables a vector data separated by comma
It will do that for cell arrays, although not numerical arrays: RX=[1.23,4.56]; RXc = num2cell(RX); [A,B] = RXc{:} producin...

7 years ago | 1

Answered
How to display decimal places
There are several options, one of which is to choose the format (link) type for what you want to do. I will let yoiu explore th...

7 years ago | 0

| accepted

Answered
add lines through origin in 3D scatter plot
One option: zx = 0; zy = 0; figure scatter3(rand(10,1), rand(10,1), rand(10,1)) hold on xline(0,'--k'); yline(0,'--k')...

7 years ago | 0

Load more