Community Profile

the cyclist

Last seen: Today
4 134 total contributions since 2011

Data scientist at Cohen Veterans Bioscience; Obsessive runner. Professional Interests: Predictive modeling, statistics. (I don't respond to email via author page, but will usually look at a question if you send me a link to it.)

View all

Contributions in
View by

set default line marker symbol
See this answer from Mathworks support.

environ 9 heures ago | 0

how to find the Reverse process of A(B).
C = [9 4 2 1 7 6 8 5 3 8 11]; A(B) = C

environ 18 heures ago | 1

How do I find the column of maximum values of a maxtrix?
Here is one way to do it. [~,linearIndex] = max(x,[],'all','linear'); % First, find the *linear* index of x [rowIndex,colIndex...

1 jour ago | 0

Area of an closed 2d plot
The polyarea function.

1 jour ago | 0

How can I do polynomial fitting when X-axis is time
Hm. Plotting the data you posted, using the seconds function, results in exactly what I would expect -- including capturing the ...

1 jour ago | 0

Get the diagonal without calculating the explicit matrix
Here is one way: % Make up some inputs N = 4; B = rand(N); C = rand(N); % Calculate the diagonal A_diag = 0; for nr = 1...

2 jours ago | 1

Find the sum of the vector using a for loop
If you type the expression 50:1 into MATLAB, you will get the result >> 50:1 ans = 1×0 empty double row vector So, y...

3 jours ago | 0

Index exceeds the number of array elements (1)
You didn't answer Ameer's first question, but it seems clear that when you call the function diggerangle(L_12, L_23, L_13, x) %...

3 jours ago | 1

How to write a custom non linear function for data fitting?
I don't have the Curve Fitting Toolbox, so I can't really comment on your current code. But, if you also have the Statistics and...

5 jours ago | 1

Plot and fit exponential decay probability of population
You are correct to use the ecdf function. I think the piece you are missing is the use of the 'censoring' input. Take a look at ...

5 jours ago | 0

| accepted

matlab gives wrong answer to determinant of a 3x3 matrix
MATLAB gives the correct result to within the limits of double-precision floating-point arithmetic. This is a very common quest...

6 jours ago | 1

How do I print unknown values
vectorA = [2 3 5 7]; ['Vector A is: [',sprintf('%6.3f', vectorA),']']

6 jours ago | 0

| accepted

How to fit multiple peaks using Gaussian funtion
Never this the original of this question, but saw the comment. If you have the Statistics and Machine Learning Toolbox, I belie...

6 jours ago | 0

Hyerbolic Functions causing issues with Contour Plots.
I ran the following code k = 0.5; l = 0.5; k1=((k+(1/2))*pi)^4; l1=((l+(1/2))*pi)^4; v1 = @(x,y) cos(k1*x)-cosh(k1*x)-(...

7 jours ago | 0

make rectangular with vectors
You say that you have a problem with "one" of your lines, but I think you have a deeper conceptual problem with how you tried to...

8 jours ago | 1

| accepted

what is wrong with my code, i am trying to plot below
FYI, there is a much more efficient solution, which is to avoid the for loop altogether: t = 1:.01:10; x = zeros(size(t)); ...

8 jours ago | 0

what is wrong with my code, i am trying to plot below
In every iteration of the for loop, you are simply overwriting x, over and over. Instead, you need to define a vector for x, to...

8 jours ago | 0

| accepted

whats wrong with my code?
He wrote dx = [0]; and you wrote dx[0];

8 jours ago | 1

| accepted

Problem with find string in array
contains(cellstr(Mfg),'bmw')

8 jours ago | 1

Save image containing plotted lines
I would expect print('-dpng','-r600','HoughLines.png') to work. You could also try the export_fig utility from the File Excha...

9 jours ago | 0

How to save any trained machine learning model to use it for prediction later?
The standard calling syntax, e.g. Mdl = fitrensemble(Tbl,ResponseVarName); stores everything you need in the model object name...

9 jours ago | 0

| accepted

Perform inverse of each double within a cell
Why do you think you cannot use cellfun? Period = {[2 3; 5 7],[11 13]}; Frequency = cellfun(@(x)1./x,Period,'UniformOutput',...

10 jours ago | 0

| accepted

factoran Error, "Some columns of the X matrix are constant."
You've asked questions about three errors: some columns of the X matrix are constant the number of factors requested, M, is to...

10 jours ago | 0

How can I generate a random number from a chi square distribution?
If you have the Statistics and Machine Learning Toolbox, you can use the randsample command to do weighted probabilities. In the...

12 jours ago | 0

how to plot cosx*coshx+1=0
I don't have the Symbolic Math Toolbox, so I can't comment on your code. But this worked for me. f = @(x) (cos(x)).*(cosh(x))+1...

12 jours ago | 0

| accepted

Which paper should be cited for the genetic algorithm used in Matlab 2019a
One source of references is the documentation for the function (which I'm guessing is where you found the reference you have). ...

15 jours ago | 0

Sparse matrix re-ordering
I tried to generalize your code as follows. A = [-1 -2 0 4 0 0 0 1 0 0; 3 2 0 0 0 0 -4 0 0 3; 0 0 5...

15 jours ago | 0

| accepted

Scatter and line problem
This code illustrates everything you asked about. % Fix the random number seed, for reproducibility rng default % Data x=[...

16 jours ago | 0

| accepted

Error with exponential term
You could type format long before running that code, or use the sprintf command to display the result. Looks like Kg1 is 0 to...

17 jours ago | 0