Matrix - Vector value matching
In each iteration of the for loop, you are looking for the closest value (regardless of whether it is larger or smaller)? One wa...

17 Tage ago | 0

| accepted

How to check if a Database exists in MongoDB
I don't have any experience with MongoDB, but my guess is that this is not so much a MATLAB Database Toolbox question as it is a...

17 Tage ago | 0

How to calculate the mean of 5 columns in a 12x80x250 array?
Q=Array(:,([8 13 27 45 52]),:); QMean = mean(Q,2); ArrayAndQMean = cat(2,Array,QMean); You could do it all in a one-liner...

18 Tage ago | 0

| accepted

Convert double array into column vector
I'm not clear on the same point that James mentioned, but I'm going to guess that the reshape command is what you need.

19 Tage ago | 0

Delete rows with bad data and surrounding rows
Here is one way. Bm2 = [ones(2,N); B(1:end-2,:)]; Bm1 = [ones(1,N); B(1:end-1,:)]; Bp1 = [B(2:end,:); ones(1,N)]; Bp2 = [B...

23 Tage ago | 0

Modify matrix of long length to match another using unique datum values
Sounds like you need the ismember command, possibly with the 'rows' argument. The exact thing you want to do (matches only in f...

24 Tage ago | 0

| accepted

Plotting estimates (fixed effects) of a linear mixed-model
I could find know no mention in the documentation of the LinearMixedModel class that there is an equivalent object function or m...

24 Tage ago | 0

How can I generate random single precision (float32) numbers ?
According to the documentation here, x = rand(10,1,"single") will do it. Your question has sufficient nuance that there could...

26 Tage ago | 0

Is it possible to store string arrays of variable length as different rows in csv?
Here is one straightforward way. It requires the cellwrite function from File Exchange. % Original data s1 = ["A" "B" "C" ...

26 Tage ago | 0

| accepted

average value and confusion matrix
Are you having trouble with the math, or with the MATLAB? This wikipedia page for the confusion matrix can help you with all the...

26 Tage ago | 0

shifting without for loop
If the vectors in the corresponding cell arrays are equal in length, then this straightforward code should work: M = 60; N = 2...

27 Tage ago | 1

| accepted

Trouble to construct histogram stracked
Take a look at the MATLAB Plot Gallery, in particular the stacked bar chart example. (I think you want a bar chart, not a histog...

27 Tage ago | 0

What is the difference between rand and copularand
It's a little difficult to know where to start with an explanation? Do you know what a copula is, and why it is used? If not, ma...

29 Tage ago | 0

| accepted

Problem with Power Regression
polyfit(...,2) is fitting a constant, linear, and quadratic term. Notice that the output vector p has three elements. You want t...

etwa ein Monat ago | 0

| accepted

Error SIGMA must be a symmetric positive semi-definite matrix
This issue will arise when you get pairwise asset correlations that are inconsistent. (The zeros are not necessarily the problem...

etwa ein Monat ago | 0

K-Means: Indices of C in idx
I'm not certain I fully understand your question, but I'll make a guess. The centroid is not (necessarily) one of the points of...

etwa ein Monat ago | 1

| accepted

Change the format of x axis in a Kernel density plot.
Instead of the plot command, use semilogx.

etwa ein Monat ago | 1

| accepted

Array indices must be positive integers or logical values.
You need to explicitly put in the multiplication sign: out(1)=(-k1*G2+k2*(G4-G2))/m1; and similarly in the assignment to out(3...

etwa ein Monat ago | 1

Plot bar chart with log scale on y axis
There are some good thoughts on how to handle this problem in response to this question. In particular, the accepted answer by M...

etwa ein Monat ago | 0

How do I obtain standarized coefficients when applying a stepwise multilinear regression?
I'm not sure I would necessarily expect coefficients to be in that range, even for normalized variables. Can you quote a referen...

etwa ein Monat ago | 0

| accepted

Generating musical note from given frequency
There is of course a lot that goes into what a note sounds like, beyond just the frequency. I expect MATLAB is generating the c...

etwa ein Monat ago | 0

problem using hold on in a for loop
Your variable N is a single value -- a scalar. (It is an array of length 1.) You then define n to be the length of that array. S...

etwa ein Monat ago | 0

add a cell array in double for one more column in uitable
Convert the numeric array into a cell array before concatenating. Then use the cell array as the input to the uitable command. ...

etwa ein Monat ago | 0

| accepted

Wrong axis value in correlation plot
I don't have the Econometrics Toolbox, so I can't confirm myself. But if that is really the only thing you did, then I think thi...

etwa ein Monat ago | 0

| accepted

create table from matrix and cell variables
I'm not certain what you want, but I think this is it. % Make up some original inputs A = rand(18,257,176); B = cell(176,1); ...

etwa ein Monat ago | 1

| accepted

How to apply function eig to an array of matrices?
cellfun(@eig,A,'UniformOutput',false) or something like this, will be at the heart of your solution. You might need to read the...

etwa ein Monat ago | 0

Running Matlab, accents are replaced by question marks in the outputs
Your code renders correctly for me in R2019a, on a mac running mojave. There are some ideas in response to this question that c...

etwa ein Monat ago | 1

How does mdl.Rsquared.Ordinary and mddl.Rsquared.Adjusted work?
R-squared and adjusted R-squared are invariant to scaling and mean-centering of the input data. So, you don't need to do it. But...

etwa ein Monat ago | 0

| accepted