Answered
Drawing Lines on a Graph
If you do not have the Mapping Toolbox, this will likely work: V = linspace(0, 30); % A...

8 years ago | 0

Answered
multiple vectors interpolation?
To interpoolate a matrix of row vectors, something like this will work: Vectors = rand(4, 10); ...

8 years ago | 1

Answered
How can ı do spike sorting to filtered EEG signal.
Try this: D = load('samp.mat'); samp = D.samp; data = 1E-3; % What Are ‘d...

8 years ago | 1

| accepted

Answered
plot3 for three dimension data
I can’t determine why it’s not automatically displaying. Use the view (link) function to make it magically appear: Fspace =...

8 years ago | 0

| accepted

Answered
How can I get proper length of FFT
To have the correct amplitudes, scale the fft by dividing it by the length of the original signal. The ‘nfft’ argument (usually...

8 years ago | 1

Answered
No text appearing in my .txt file using fprintf
I’ve never seen that particular syntax. Try this: fid1 = fopen(wavfilecd,'w'); fprintf(fid1,'%s \t %s \t %s \n',...

8 years ago | 0

| accepted

Answered
How can I get the maximum line of multiple graphs, starting from different x-values?
This was something of a challenge! The Code — hold all t =0:0.01:2*pi; x=sin(t); hL(1)=plot(t-0.5,x+1); hL(2)=plot(t+0....

8 years ago | 0

| accepted

Answered
nonlinear constrain error must return real value
The expression beginning with ‘x(13)’ contains a log argument that could become negative if ‘x(11)’ is greater than 150, and sim...

8 years ago | 0

Answered
Sparse matrix in OLS , sparse matrix transpose and multiply
See if the lsqr (link) function will do what you want.

8 years ago | 0

| accepted

Answered
How to fill the space between these lines?
The easiest way is to define two overlapping rectangles: figure hold all patch([L1(end,1); R1(end,1); flipud([L1(end,1); R1(...

8 years ago | 1

| accepted

Answered
Rotating and shifting a meshgrid
One approach: %Create the meshgrid Xinit = 0:3125:800000; Yinit = 0:3125:800000; [Xq,Yq] = meshgrid(Xinit,Yinit); Z = sin(...

8 years ago | 4

| accepted

Answered
Char function for a cell array
Try this: Name = {'MATE' 'GEAR' 'FIVE' 'SLOW'}; Name = reshape(Name, [], 1); NameC = cell2mat(Name) producing: NameC = ...

8 years ago | 0

Answered
Finding ALL the indicies that match a certain value
Use the find function: A = 4; B = [ 3 5 4 6 4 6 7 ]; idx = find(B == A) producing: idx = 3 5

8 years ago | 1

Answered
How to use log/exponential forms for line of best fit?
You could do a log transformation, however that distorts the errors and (unless the errors are negligable), a less than optimum ...

8 years ago | 0

Answered
How can I solve this vector lenght problem?
Change your ‘tankmodel’ function to this and it works: function dydt = tankmodel(t,yv) format long %%%Dataset Parameters W...

8 years ago | 1

| accepted

Answered
Solving non linear equation for x
Using the Optimization Toolbox fsolve function: eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x)); xval = f...

8 years ago | 0

Answered
Make x axis ticks and extent match
We can’t run your code. You appear to be using 4 different date vectors, one for each subplot. It may be worth exploring them ...

8 years ago | 0

Answered
How can I get the main peaks from a signal with a lot of noises?
That appears to be a Fourier transform of a noisy signal. If so, because the noise is broadband, a frequency-selective filter o...

8 years ago | 0

| accepted

Answered
Bar chart colors depending on their value
Try this: req = [10,5,3]; data=[9,6,3]; hb1 = bar(req,0.5); newXticklabel = {'label1','label2','label3'}; set(gca,'Xtick...

8 years ago | 1

| accepted

Answered
How do I save my data from each loop iteration into a single matrix?
Without knowing what size your variables ‘rf_data’ and ‘tstart’ are, the easiest way would be to save them to cell arrays, then ...

8 years ago | 0

Answered
How to 'crop' a graph?
I’m not certain what you want. One solution: % Plot u time history zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); ...

8 years ago | 1

| accepted

Answered
Code seems to not be printing out the value I need, as well as not graphing points on the figure. Need help, I don't know how to fix this.
Now I can read it, although understranding your notes remains a problem. You still have not described what you want to do wit...

8 years ago | 0

Answered
I want to plot axes with actual dimensions, in inches.
See the axes documentation section on 'Units' for a discussion on how to set them.

8 years ago | 0

Answered
How can I combine those lines into a surface (plot3) to surface
See if this does what you want: T_Mtx = ([1.4; 1.2; 1; 0.8; 0.6] * ones(1,10))'; SOI = xlsread('internal_2.xlsx', 1, 'A2:A1...

8 years ago | 0

| accepted

Answered
MATLAB function for finding intersection points between line and multiple polygon
One option is to use the inpolygon function: rctnglx = [1 1 3 3 1]; % Create Data rctngly = ...

8 years ago | 0

| accepted

Answered
In the code below, what does ind do?
It evaluates a function called ‘ff’ with the argument ‘pop’, and assigns it to the variable ‘cost’. It then sorts ‘cost’, gets ...

8 years ago | 1

| accepted

Answered
fitted curve start from zero?
The easiest way is to not specify a y-intercept in the model you want to fit. Example — x = 0:2:100; y = 3E+3 - (x-50).^2 +...

8 years ago | 2

Answered
Why would circshift stop working.
What is the value of ‘td’? If it is 0, you won’t see any shift. Is ‘spect2’ a vector or a matrix? (I couldn’t tell from you...

8 years ago | 0

| accepted

Answered
Hello I have that emg signal (after using filter) as you see there is 5 different segments .I have to split these segments. How can ı develop automatic identification of these segments ?
I would use the findpeaks (link) function: [pks,locs] = findpeaks(-your_signal) Note the negation (‘-your_signal’). This fli...

8 years ago | 0

| accepted

Answered
how to multiply a row with 1st and 2nd row of a matrix seperately
One option is to use the bsxfun (link) function: y_0 = [0 1 1 0 1 0 0 1 0 1 1 0 ...

8 years ago | 0

Load more