Answered
How can I combine these two MATLAB codes? (MATLAB)
Use the hold command figure hold on plot(t, y2, 'linewidth', 2); plot(t,y,'linewidth',2); and then your other commands for ...

5 years ago | 0

Answered
[SOLVED]: I'm getting the error "Array dimensions must match"
I recommend that you use the debugger to investigate. Specifically, set a breakpoint at the line U = F.*(ones(sz) + Beta.* L); ...

5 years ago | 1

| accepted

Answered
Why do I get non-zero standard deviation in data with no variability?
Your standard deviaions are zero -- to within the accuracy possible by calculation in floating point numbers. The first referen...

5 years ago | 1

Answered
How can I fit data to a system of implicit equations?
I'm pretty sure that this is a really tricky problem to solve, and I am not certain it can be done in MATLAB. (When I say this, ...

5 years ago | 0

Answered
how can i determine angle between 2 variables
You got the order of the inputs incorrect. It should be atan2(rAy,rAx)*g This will give a negative answer, measuring the angle...

5 years ago | 0

Answered
Not enough input arguments.
How are you calling the function? If you call it like this ... Fillter() then you will get that error because Fillter is expec...

5 years ago | 0

| accepted

Answered
The logical indices in position 1 contain a true value outside of the array bounds.
You don't give enough information to diagnose why this is happening in your code, but here is an example of that error and how i...

5 years ago | 2

Answered
Illegal use of reserved keyword "end"
In the statement s2=[a2(length(a2)) max([a2,a3,a4,a5,a6,a7,a11,a13,a17,a19,a23,a25,a29,a31,a35,a37]); you seem to have missed ...

5 years ago | 0

| accepted

Answered
i am a beginner matlab user , and i have problem with the number of decimal places , i need to increase them , what should i do ? here is the code , can anyone just edit it to increase the number of decimal places
You can use the format command, e.g. format long Note that MATLAB always stores the result as double precision by default -- y...

5 years ago | 0

| accepted

Answered
Using chaotic sequence to generate random numbers
This GitHub repo has a MATLAB implementation. I cannot attest to its quality.

5 years ago | 0

| accepted

Answered
How can I change this 3-D array(2000,21,80) to 4-D array(1000,20,21,80)?
Did you mean (1000,2,21,80)? If so, then you can use the reshape command: output = reshape(x,[1000,2,21,80]); where x is your ...

5 years ago | 0

Answered
finding a value of x for a given y
interp1(y,x,80)

5 years ago | 0

| accepted

Answered
Resample from a nonuniform time history while keeping the peak and valley values
There is almost certainly not a built-in function that does this resampling in the exact way you want. Instead, you need to thin...

5 years ago | 0

Answered
"Error using plot, Value not a numeric scalar"
The LineWidth parameter should just be the number 2 (without quotes), not the character '2'. After that, you are going to run...

5 years ago | 0

Answered
Convert each cell to 4D
The best method to do this might depend on how generalizable you need this to be to other cell arrays (with different internal a...

5 years ago | 0

Answered
Fourier transform for a sequence of values
fft(x)

5 years ago | 0

Answered
Why can't I use fplot command ?
fplot expects a function as input. I think you want the plot command instead, which expects numerical vector input ... plot(x_t...

5 years ago | 1

Answered
Correlation of two variables over time: can this happen?
Yes. This is known as Simpson's Paradox. Here is an example: rng default x1 = [1 2 3 4 6 7 8 9]'; x2 = [1 2 3 4 -6 -5 -...

5 years ago | 1

| accepted

Answered
errorbar for x and y
This code works for me. What version of MATLAB are you running? If you have an older version, and cannot update, then you could...

5 years ago | 0

| accepted

Answered
matrix variable problem in matlab
This documentation about indexing with logical values might help you understand.

5 years ago | 0

Answered
I want to solve a problem with just numbers from 0 to 2, how do I do that?
Are you sure you copied everything from the assignment correctly? Can you post the text of the assignment here? I did the Gauss...

5 years ago | 0

Answered
how to find index of matrix
It looks like you were checking the wrong columns. row = find (A(:,2)==9 & A(:,3)==5.125) Also, you need to use & rather than ...

5 years ago | 1

Answered
Index exceeds the number of array elements
This is not strictly an answer to your question, but I recommend learning how to use the debugger. Then you will be able to pinp...

5 years ago | 0

Answered
How to plot this figure? please help me.
I suggest you look for code for a similar figure in the MATLAB Plot Gallery.

5 years ago | 0

| accepted

Answered
How to reorganize an array given an index
Here is one way: % Inputs array = [1,2,3,4,5,NaN,NaN,NaN]; idx_flag = [1,4,8]; % Get length of array for convenience L = ...

5 years ago | 1

| accepted

Answered
How can I plot a histogram out of a vector of percentages
I don't think you want a histogram (which would create the percentages from the raw data). I think you just need a bar graph.

5 years ago | 0

| accepted

Answered
how to calculate distance euclidean
c(m,n) is the absolute value of the difference between the m-th element of the vector stored in a and the n-th element of the ve...

5 years ago | 0

Answered
My is my matrix can't multiply with this vector
Your variables tranposeA and y have sizes 2x4 and 1x4, respectively. It is unclear to me whether you wanted a matrix multiplica...

5 years ago | 0

| accepted

Answered
How to assemble 3D array from four vectors
Here is one way: G = reshape([FF; MF; FM; MM],2,2,6)

5 years ago | 0

| accepted

Answered
how to graph using loop?
Put the command hold on on the line after figure. See the documentation for the hold command for details.

5 years ago | 0

| accepted

Load more