Answered
hello, I am a real noob with matlab, and coding in general. I am trying to get a vector to display the different values for 'x' based on the angle and the D2 value. I am sure i need to use a for loop but i have no real idea how. please help!
The default increment or ‘step’ using the <http://www.mathworks.com/help/matlab/ref/colon.html *|colon|*> (link) operator is *|1...

8 years ago | 1

| accepted

Answered
ismembertol not working correctly
Only the first output of *|ismember|* or *|ismembertol|* is a logical array. The second output, the one you are asking for, acc...

8 years ago | 0

| accepted

Answered
how can I plot this exponential function?
Since *|‘G’|* is a _function handle_, you cannot plot it. You need to call it as a function and plot its output, so plot it...

8 years ago | 1

| accepted

Answered
50hz notch zero pole placement filter
See the documentation example on: <http://www.mathworks.com/help/signal/ug/remove-the-60-hz-hum-from-a-signal.html *Remove the 6...

8 years ago | 0

Answered
Sort Cell Array Data
You haven’t stated the result you want. Try this: [F,S,R] = xlsread('Matlabhelp.csv'); t = F(:,1); date = datet...

8 years ago | 1

| accepted

Answered
loop over a list of numbers, Part 2
I tested this with the previous code to be certain it works. It does: lgndcell = regexp(sprintf('%2d Bidders (Mean: %.2f,...

8 years ago | 0

| accepted

Answered
loop over a list of numbers
The loop, if one is appropriate, depends on what you want to do. This is an example of how to address them: numli...

8 years ago | 4

| accepted

Answered
Why wont my program connect the x markers together in plot, despite having the '-x' function?
The easiest way is to save the elements of *|‘sv’|* as elements of another vector, then plot them together: sv = 0; jv ...

8 years ago | 0

| accepted

Answered
How can i plot the ECG from this txt file?
That has to be the strangest format for an EKG file I have ever seen. There appear to be *|9|* different leads. (It appears to...

8 years ago | 0

| accepted

Answered
Calculate an unknown equation coefficient
You can certainly use *|fminsearch|* for your problem, however since you are regressing a _linear_ system, you can use <https://...

8 years ago | 0

| accepted

Answered
How to assign lables of box plot
Try this: Dataset = [ 1 3 5 12 23 56 12 15 26 18 28 23 ...

8 years ago | 1

| accepted

Answered
Matlab Question regarding the correct use of contourf
I would plot it as: figure contourf(force) and then define the desired *|'XTick'|* and *|'YTick'|* vectors, and set ...

8 years ago | 0

Answered
problem while Solving nonlinear system
This corrected code works for me: function F = root3d(x) F(1) = 3* x(1)- cos(x(2).*x(3)) - 0.5 ; F(2) = x(1).^2-81 ....

8 years ago | 0

Answered
How to detect pacing pulses in ECG signal?
You are correct. The spikes that you have identified with the black dots are pacing spikes. You should see them in all leads. ...

8 years ago | 0

| accepted

Answered
How can I solve this set of complex equations?
There are of course an infinity of solutions to any equations involving periodic functions. Here is a way to get some of th...

8 years ago | 0

Answered
How to speed up code for converting an array of strings to array of numbers
I have no idea what your final goal is. Note that the *|unique|* function has as as many as *|3|* outputs. The first are t...

8 years ago | 0

| accepted

Answered
Creating a 3D surface of multiple lines
This works (in *|R2018a|*): figure surf(r, Vfvec, f) grid on xlabel('\bfr\rm') ylabel('\bfVfvec\rm') zlabel...

8 years ago | 0

| accepted

Answered
how to deletes rows after a certain row
Try this: Data = randi(99, 100, 1); % Create Data Sorted_Data = sort(Data, 'descend'); ...

8 years ago | 0

| accepted

Answered
How do I fix an equation in a for loop?
Save *|‘DelM’|* as a cell array: DelM{i} = ... noting the curly braces *|‘{}’|* denoting a cell array. Then sort it o...

8 years ago | 0

Answered
How do I fix this error "In an assignment A(:) = B, the number of elements in A and B must be the same."?
Save *|‘DelM’|* as a cell array: DelM{i} = ... noting the curly braces *|‘{}’|* denoting a cell array. Then sort it o...

8 years ago | 0

Answered
dealing with "At least one END is missing: the statement may begin here."
Highlight your code in the MATLAB Editor, then use *|Ctrl+I|* to use the ‘Smart Indent’ option. That should help you discover w...

8 years ago | 0

| accepted

Answered
FFT within a moving window of an audio signal
Use the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/spectrogram.html *|spectrogram|*> (link) function. ...

8 years ago | 1

| accepted

Answered
Plot: vertical legend for x axis
See if you can use the <https://www.mathworks.com/help/matlab/ref/matlab.graphics.axis.axes-properties.html#budumk7-XTickLabelRo...

8 years ago | 0

| accepted

Answered
error message in legend
One possible solution: OutputSpacing = rand(3); figure plot(1:3, OutputSpacing, 'p') lgndcell = regexp(sprintf('%...

8 years ago | 0

| accepted

Answered
For loop in a plot
Use the <https://www.mathworks.com/help/matlab/ref/hold.html *|hold|*> (link) function, or alternatively: hAxes = axes('Nex...

8 years ago | 0

| accepted

Answered
Make Function Equal Zero After Certain Time
Try this: aa = @(t, Tas) sin((pi*t)/Tas) .* ((0 <= t) & (t <= Tas)); % Function, With Conditions As A Logcal Inde...

8 years ago | 0

| accepted

Answered
How do I connect data points with sine or cosine curves
See: <http://www.mathworks.com/matlabcentral/answers/121579-curve-fitting-to-a-sinusoidal-function *Curve fitting to a sinusoida...

8 years ago | 0

Answered
how to store elements from 2 arrays into another array?
Probably the easiest way: a = [1,2,3,4,5]; b = [6,7,8,9,10]; c = [a(:) b(:)] c = 1 6 2 ...

8 years ago | 0

| accepted

Answered
Confidence band around linear least-squares line
One option is the Statistics and Machine Learning Toolbox <https://www.mathworks.com/help/stats/fitlm.html *|fitlm|*> (link) fu...

8 years ago | 1

| accepted

Answered
Plot two surfaces each with different color
I’m not certain what you want. Try this: [X,Y] = meshgrid(linspace(-2, 2, 50)); Z = @(x,y,c) x.^2 + y.^2 + c; ...

8 years ago | 5

| accepted

Load more