Answered
Delete the center in an array?
*_‘I want to delete specific elements(3x3 or 2x2 whatever) inside a big array, and convert the rest of this array into a vector....

9 years ago | 0

| accepted

Answered
How to find linear regression of data as follows
I would make two small changes in your code: logb = log10(b); A = [a,ones(size(logb))]; c = A\logb; y = 10.^(A...

9 years ago | 0

| accepted

Answered
How to add markers to a plot after using fzero
I would use a loop to create a vector for *|‘z’|*: x=-2*pi : 2*pi; y=3*x.*sin(x)-2*x; y1=3*sin(x)+3*x.*cos(x)-2; ...

9 years ago | 0

| accepted

Answered
Need help finding a value on a graph
One option is to use the *|interp1|* function. Remember that if you want to find *|x|* for a given *|y|*, use *|(y,x)|* rather ...

9 years ago | 0

Answered
Fitting procedure for cochlear mechanics
I worked on this for a while, going to my favourite global optimisation routine, the genetic algorithm, the Global Optimization ...

9 years ago | 0

Answered
import time into matrix and display as minutes after midnight
It appears to be in fractions of a day, so multiply it by minutes in a day: t = 0.416666666666667; min_after_mn = t * 2...

9 years ago | 1

| accepted

Answered
Finding the row number with two conditions in a matrix
I am not certain what you want to do. Calculating the separate parts of the conditions that create *|‘idx’|* separately and...

9 years ago | 1

| accepted

Answered
integral function not working
You need to create a ‘function handle’ to the *|exp|* function with an *|‘@’|* sign: q = integral(@exp,0,1) q = ...

9 years ago | 0

| accepted

Answered
Change of expontial precision
I wrote a little utility program a while ago to do just that (for use in *|text|* object strings): Q1 = 4.123E2; expstr...

9 years ago | 0

| accepted

Answered
solving state variable equation in matlab
Your integrated differential equation is the matrix exponential, given by the *|expm|* function (in both base MATLAB and the Sym...

9 years ago | 0

Answered
How can I use idx to apply different if statements to each column in a matrix?
This works: participant_data = [390 .45; 347 .32; 866 .98; 549 .67]; save_data_idx = (participant_data(:,1) > 500) & (p...

9 years ago | 0

Answered
How to plot period on a x axis of a fourier transformed dataset?
I am not certain what you want. The period is *|1/F|*, where *|‘F’|* is frequency, so one way to accomplish that would be t...

9 years ago | 0

| accepted

Answered
Getting only one output from a function with several ones
You must not be asking for both outputs. Try something like this in your calling script: [x1, resultVec] = newt(x0); ...

9 years ago | 0

| accepted

Answered
FFT of EMG Signal
See the documentation on <https://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*> (link).

9 years ago | 1

Answered
How can i solve this equation with matlab ?
If you have the Symbolic Math Toolbox (with a slightly revised version of your equations) this works: syms x y z k Eq1...

9 years ago | 0

Answered
3D plotting of experimental data
This should get you started: [D,S,R] = xlsread('predicted MUF day(12).xls'); Time = D(:,1); MUF_Distc = regexp(S, '\...

9 years ago | 0

| accepted

Answered
Line of best fit
Use the *|ones|* function: A = [(10:10:50)' ones(5,1)]; b = [8;7;4;6;3]; coeff = A\b new = A*coeff so *|‘XX’|*...

9 years ago | 0

Answered
i need a matlab commande or function that gives me the nearest number in a vector "V" to a number "x"
The <https://www.mathworks.com/help/matlab/ref/hypot.html *|hypot|*> (link) function will probably help. This seems quite l...

9 years ago | 0

Answered
Bucle doesn't end
It is called ‘floating-point approximation error’, and is analogous to representing the fraction *|‘1/3’|* in decimal notation, ...

9 years ago | 1

Answered
How to get 2 or more graphs in different windows?
See the documentation on <https://www.mathworks.com/help/matlab/ref/subplot.html *|subplot|*> (link).

9 years ago | 0

Answered
How to split an array into individual values?
Reading the documentation, you will find that: Gradient = P(1); Intercept = P(2);

9 years ago | 0

| accepted

Answered
3D plott whit log scale on x and y and divide inside the plot base
You created *|‘X’|* and *|‘Y’|* (corresponding to *|‘f’|* and *|‘B’|*) correctly. You need to completely vectorize the *|‘Loss’...

9 years ago | 0

| accepted

Answered
I can do a cylinder with surf??
The <https://www.mathworks.com/help/matlab/ref/cylinder.html *|cylinder|*> (link) function is one option. If you do not wan...

9 years ago | 0

Answered
what's wrong with my 3d plot?
If you add this *|max|* call to your code (after you calculate *|‘z’|*), you arrive at a different result: max_z = max(z(:...

9 years ago | 0

| accepted

Answered
why am I getting .99999999999
It is ‘floating-point approximation error’. It is similar to the problem of representing the fraction *|‘1/3’|* in decimal nota...

9 years ago | 0

| accepted

Answered
why is roots function not working properly?
According to the error message, you have a *_script_* on your path also named *|‘roots’|*. The solution is to change the name o...

9 years ago | 2

| accepted

Answered
Why do I keep getting an undefined function or variable error?
See if copying it to: C:\Users\cmcmechan\Documents\MATLAB\ solves the problem. I don’t know how you have your path set...

9 years ago | 0

Answered
I want to make a linear interpolation a cubic spline of the second order interpolation. How?
My _guess_ is that you refer to this assignment: alpha_y_f=interp1(10000./alpha_x,alpha_y,F,'pchip'); so to use a splin...

9 years ago | 0

Answered
Finding the geometric mean of inputted numbers??
One approach: . . . v = [a b c]; x = geomean(v); y = mean(v); . . .

9 years ago | 0

Answered
Loop through hundreds of matrices to change values larger than 1 to 0
Instead of *|find|*, I would simply use ‘logical indexing’. *_Example_ —* yf = 0.5 + rand(4,5) yf(yf > 1) = 0 ...

9 years ago | 1

Load more