Community Profile

photo

the cyclist


Last seen: Today
4 439 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.)

Contact

the cyclist's Badges

  • Scavenger Finisher
  • Master
  • Thankful Level 4
  • 36 Month Streak
  • Likeable
  • Famous
  • Quiz Master
  • First Review
  • First Submission
  • Revival Level 3
  • Knowledgeable Level 4
  • First Answer
  • Puzzler
  • Speed Demon
  • Creator

View all

Contributions in
View by

Answered
How to Split data into 3 equal parts (A,B,C) with balanced numbers of each subclass.
Probably the easiest way to do this would be with the following steps: Isolate each of the classes, using something like "Y == ...

environ 2 heures ago | 0

Answered
Plotting graphs with setting my own scales
figure hold on fplot (@ (x)x.^2 -2) fplot (@(x) sqrt(x+2)) fplot (@(x) (x.^2 + 2)./(2*x-1) ) fplot (@(x) (x.^2 + 2)./(2*...

environ 18 heures ago | 0

| accepted

Answered
How I plot this ?
You can use the fimplicit function. alpha1=0.1; alpha2=0.2; beta1=0.2; beta2=1; gamma=1.3; f = @(x,y) log((1+alpha1*x./(1+alph...

2 jours ago | 0

Answered
How I plot this ?
Here is one way: alpha1=0.1; alpha2=0.2; beta1=0.2; beta2=1; gamma=1.3; x = 0 : 0.1 : 10; y = 0 : 0.1 : 10; [xx,yy] = me...

2 jours ago | 1

| accepted

Answered
Adding 2 string row to beginning row and end row of a matrix
A numeric data type cannot hold text. You'll need to store your data in a variable that can hold mixed types. One possibility is...

2 jours ago | 0

| accepted

Answered
For the following code, It shows my 51 iterations, however i only want to display the last iteration
Looks like you could just pull these lines out, and put them after the end statement of the loop: disp(['Error as percentage: '...

2 jours ago | 0

Answered
Concatenate vertically multiple tables with different dimensions
You can do this with the outerjoin command: A = table([1001; 1002; 1003],{'Jones';'James';'Robert'},... 'VariableNames...

3 jours ago | 0

| accepted

Answered
Standard deviation of values with standard deviation
The question you are asking is a specific instance of "propagation of uncertainty". You might want to learn more about the topic...

3 jours ago | 2

| accepted

Answered
How to remove elements from two arrays when one of them has a zero
idx_to_remove = target_2019==0; target_2019(idx_to_remove) = []; output_2019(idx_to_remove) = [];

3 jours ago | 1

Answered
Put specific name in file via writematrix
You need to concatenate the character arrays. Here is one way to do that: str='2020' writematrix(A,['output',str,'.xlsx'])

7 jours ago | 0

| accepted

Answered
Displaying a group of vectors on separate lines
You can use a semicolon to concatenate vertically [a; b; c]

8 jours ago | 0

Answered
Issues converting a Cell to a numerical array
Here is one way that may work for you: C = {1, 3, 7, 7, 'a'}; N = cell2mat(C(cellfun(@isnumeric,C)))

10 jours ago | 0

Answered
3D Matrix Multiplication
You can do it straightforwardly with a for loop: % Some made-up input data A = rand(3,1,4); B = rand(3,3,4); [mA,nA,pA] = ...

10 jours ago | 0

| accepted

Answered
fitlm() with 0 intercept function returns different values for R2 betwen MATLAB 2020a and 2020b?
Interesting. The 2020b result seems to be correct, based on the formula using sums of squares. (See, e.g. the definition on wiki...

11 jours ago | 1

| accepted

Answered
Creating a Histogram of Letter grades converted from number grades
I'm sorry to say that the approach in your code is so misguided, that it is probably not worth debugging it. You need a differen...

11 jours ago | 0

Answered
how to get random pair ?
How are these pairs currently stored? This seems equivalent to just choosing a random number from 1-6, so you could do idx = r...

11 jours ago | 0

Answered
How to plot function with variable input like shown in figure?
I didn't fully understand what you are trying to do, but the fplot command might be useful.

12 jours ago | 0

Answered
Producing a NaN only where there is a NaN, zero otherwise
Second attempt ... X = [-inf, -1, -eps, 0, realmin, 2, 1+i, pi, flintmax, realmax, inf, NaN]; broken = @(x) 0./(isnan(x)-1); %...

12 jours ago | 1

Answered
Producing a NaN only where there is a NaN, zero otherwise
First attempt: X = [-inf, -1, -eps, 0, realmin, 2, 1+i, pi, flintmax, realmax, inf, NaN]; broken = @(x) 1./((isnan(x)-1)/0); %...

12 jours ago | 1

Answered
How do I remove NaN's from my data?
If your numeric vector is called "x", then x(isnan(x)) = []; will remove the NaN values.

13 jours ago | 0

Answered
Plot of 4D coordinates
You may be able to find something you can adapt at the MATLAB Plot Gallery.

13 jours ago | 0

Answered
How to get the first value in a set of array that is bigger than the first few values?
Because x and y are not the same length, I'm not sure how to make the "correspondence" between them. However, this code snippet ...

14 jours ago | 1

Answered
Using if condition store values in an array
If I understand you correctly, this does what you want. (It doesn't directly use "if", but does the job via logical indexing ins...

15 jours ago | 0

| accepted

Answered
Sort an Array with sortrows ( ) with two columns
See my answer (and other comments) to this very similar question. (As with the comments above, the premise is that the displayed...

15 jours ago | 1

Answered
How to make slope 1in fitlm?
I don't believe you can do it with fitlm, but you can with fitnlm: % Set seed for reproducibility rng default % Make up som...

15 jours ago | 0

| accepted

Answered
Multiplying a Matrix with every column of another matrix
Do you mean you just want to do standard matrix multipication? C = A * B Or did I misunderstand?

16 jours ago | 1

| accepted

Answered
How to remove this error?
We can't really answer that for you, because we need more information. Suppose x = [1 2 3 4]; y = [5 6 2 3]; If I want to pl...

16 jours ago | 0

Answered
What is prodofsize?
It is mentioned in the "Backward Compatibility" section of the documentation of cellfun, although there doesn't seem to be any i...

17 jours ago | 0

| accepted

Answered
Array indices must be positive integers or logical values error
You need X = (2*r2*((cosd(0)*cosd(theta2)))); instead of X = (2*r2((cosd(0)*cosd(theta2)))); (Note that I used r2* instead o...

17 jours ago | 0

Answered
How to insert multiple element after specific numbers in a vector?
Here is one way % Original logical vector input L = logical([1 0 1 1 0]); % The numbers to be inserted oneNum = 6; zeroNu...

20 jours ago | 0

Load more