Answered
Hello every one i have an error when run this code can eny help?
You inserted an underscore *|_|* character at the end of *|‘function’|*: function_ [im_alt] = altertxt(im_tx1,im_tx2) ...

8 years ago | 1

Answered
Discrete Surface Plots (Data visualization)
I am not certain what you want. Hereare two options, the first simply a ‘patchwork’ plane, and the second a 3D *|bar3|* plo...

8 years ago | 0

Answered
I can't figure out why I am getting the error message Matrix dimensions must agree.
The problem is that *|‘c’|* and everything you calculate from it are *|(1x8)|* vectors and *|‘t’|* is a *|(201x1)|* vector. You...

8 years ago | 0

| accepted

Answered
Very new to matlab and can't figure out how to plot 3 functions on a graph with a domain.
There are several ways, one of which is to use the <https://www.mathworks.com/help/matlab/ref/hold.html *|hold|*> (link) functio...

8 years ago | 0

Answered
how to split one dimensional array into 3 equal chunks?
Try this: s = load('Cb.mat'); Cb = s.Cb; var3c = @(oldvar) mat2cell(oldvar(:), [fix(numel(oldvar)/3) *[1, 1], nu...

8 years ago | 1

| accepted

Answered
How can i obtain different frequencies from a waveform using FFT?
It doesn’t look correct to me either. I would not use the Savitzky-Golay filter here, at least not with you original data. ...

8 years ago | 1

| accepted

Answered
Having trouble displaying histogram of cosine wave
You need to reverse the order of the arguments to your *|hist|* call: hist(x_cos, x) The ‘bin’ argument is second, you...

8 years ago | 0

| accepted

Answered
How to set domain for p(x)/q(x) functions?
Your function has a singularity at *|‘x=2’|*. If you simply want to plot it, this works: x = linspace(0, 4, 250); f = ...

8 years ago | 0

Answered
how do I use datetick for this code?
I would code it differently: fidi = fopen('7633_Flux_AmeriFluxFormat_3.dat'); A = textscan(fidi,'%f %f %f %f %f %f %f %...

8 years ago | 0

| accepted

Answered
How do I save each value for this loop?
I am not certain what you want. Try this: N = 5; A = 0; w = 1; %where omega is equals to 2pi/tau and tau is...

8 years ago | 0

| accepted

Answered
Filtering Jerk from data
I would first do a Fourier transform (using the <http://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*> (lin...

8 years ago | 0

Answered
How do I display a value on bar?
Try this (if you have *|R2014b|* or later): y1 = [2 2 3; 2 5 6; 2 8 9; 2 11 12]; hBar = bar(y1,1); ...

8 years ago | 3

| accepted

Answered
How to plot this stepfunction
For the unit step function, you can use the Symbolic Math Toolbox *|heaviside|* function, or this anonymous function: ustp...

8 years ago | 0

Answered
How to find numerical solutions of equation using fzero or solve
The documentation describes their use: * <https://www.mathworks.com/help/optim/ug/fzero.html *|fzero|*> * <https://www.math...

8 years ago | 0

Answered
Why this does not work?
In order for it to be a function, the *_first_* line of your *|‘EdoVL.m’|* file should be: function dydt = EdoVL(t,y,m,k,c...

8 years ago | 0

Answered
How to change two variables at same time in a loop?
I would define *|‘v’|* within the loop as: v = (1.*(rem(i,2)==1)) + (2.*(rem(i,2)==0)); Your loops would then become: ...

8 years ago | 2

| accepted

Answered
simple question regarding ezplot
You have to set it _after_ the plot: eh = ezplot(f); set(eh, 'Color','r')

8 years ago | 0

| accepted

Answered
question for a beginner
Not necessarily. This works: syms y(x) y(x) = x^2; as will this: syms y x y(x) = x^2; while thi...

8 years ago | 0

| accepted

Answered
How to change the default x-axis unit in a Bode diagram to Hertz?
Use <https://www.mathworks.com/help/control/ref/bodeplot.html *|bodeplot|*> (link) instead of *|bode|*. It gives you that o...

8 years ago | 1

| accepted

Answered
How to output Ohm symbol on command window?
This works for me in *|R2018b|*: Ohm = char(hex2dec('03A9')); fprintf(1, '1V/1A = 1%s\n', Ohm) producing: 1V/1...

8 years ago | 0

Answered
Why my plot doesn't show the line?
I seee two problems: First, you need to define *|‘X’|* as: X=0:499; Second, MATLAB is _case-sensitive_, so *|‘x’|* ...

8 years ago | 1

| accepted

Answered
another basic questions regarding integration
It ‘translates’ to: _‘integrate *|f|* with respect to *|‘x’|* from *|‘y’|* to *|‘y’|*’_. Since the limits of integration are th...

8 years ago | 0

| accepted

Answered
another basic question for a beginner
Without knowing the relevant context, it is difficult to say. The first syntax: fzero(f,x0) implies that *|‘f’|* i...

8 years ago | 0

| accepted

Answered
how can i use continued fraction approximation of a transfer function of order 5 in matlab
With difficulty. You need to have the full precision of your transfer function, not simply what you posted. This is an...

8 years ago | 0

Answered
Why are there minor differences in the creation of two time series for signal generation?
It is most likely due to the way the <http://www.mathworks.com/help/matlab/ref/colon.html *|colon|*> (link) operator works, and ...

8 years ago | 1

| accepted

Answered
Problem with solve and icdf
It is probably best to avoid the Symbolic Math Toolbox for such problems. Try this: b = @(x,s,bb) x-s*icdf('Normal',b...

8 years ago | 0

| accepted

Answered
Making a 2D plot of an equation against 2 datasets
For a 2D version, try this: x = 1:1:20; y = 1:0.5:8; z = bsxfun(@times, x, y'); z(z >= 10) = NaN; figure ...

8 years ago | 0

Answered
No obvious maximum in power spectral density graph
You *_are_* seeing a peak, just not the one you’re anticipating. The reason is that you have a significant d-c (constant) offse...

8 years ago | 0

| accepted

Answered
How to find the max value of a function with two variables
This seems to work: idx = find(v == max(v(:))); % Index Of Maximum ‘v’ Then to test to see if t...

8 years ago | 0

| accepted

Answered
removing spikes from test data.
If you have the newly-released *|R2018b|*, see if the <https://www.mathworks.com/help/matlab/ref/rmoutliers.html *|rmoutliers|*>...

8 years ago | 1

Load more