Community Profile

photo

the cyclist


3,727 total contributions since 2011

Data scientist at Cohen Veterans Bioscience; Obsessive runner. Professional Interests: Predictive modeling, statistics.

Contact

the cyclist's Badges

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

View all

Contributions in
View by

Answered
How to print figure to an .eps file properly?
Try using '-opengl' rather than '-painters' for the renderer.

5 hours ago | 0

Answered
Creating means in a table for a specific subnum
I think you might be able to do what you want using the groupsummary function.

23 hours ago | 0

Answered
How to print figure to an .eps file properly?
Try using export_fig.

2 days ago | 0

Answered
How to fit data to a curve with known error bars and draw it?
Do you mean that you want to do a fit where both your x and y variables have known measurement error? (Unlike, say, an ordinary ...

2 days ago | 0

Answered
Subscript indices must either be real positive integers or logicals.
Unlike some other programming languages (e.g. python), MATLAB has 1-based indexing. The first element of the array A would be re...

2 days ago | 0

Answered
Printing row index or row of a matrix by searching for a particular value?
rowIndex = find(mat(:,1)==31); % Row index row = mat(mat(:,1)==31,:); % Row Note that one doesn't need the find command to get...

2 days ago | 0

| accepted

Answered
How to plot below function of two variables
x = 0 : 0.02 : 2; % 2 is not equal to infinity, but it shows the behavior. y = 0 : 0.02 : 2; [xx,yy] = meshgrid(x,y); f =...

4 days ago | 0

| accepted

Answered
Relate a value obtained with values that formed it (Vector Relationship)
Assuming those are all numeric vectors of the same length, then [min_SLL,min_idx] = min(SLL); min_dx1 = dx1(min_idx); min_dy1...

5 days ago | 1

| accepted

Answered
How to reshape nested cell arrays in a table
Here is one way: t.Var2 = {reshape(t.Var2{:},4,12)} and analogously for Var3 and Var4. Parsing what that is doing, from the i...

5 days ago | 1

Answered
How to retrieve data from a website?
According to its documentation page, use of urlread is not recommended. It suggests using webread instead.

5 days ago | 0

Answered
How to crate only 5 plots out of the 20000 iterations?
Use if mod(k,5000)==0 ... end and just figure or figure(k/5000) Just using the figure command (without any argument)...

6 days ago | 0

| accepted

Answered
lagrangian polynomial function giving the incorrect answer
I don't have a solution for you, but I can say that the line xprod=xprod*((c-Xlist(j))/(Xlist(i)-Xlist(j))); is never reached ...

6 days ago | 1

Answered
Arrange be in order of their pairing, and count how many times they appear
[C,~,idx] = unique(B,'row'); D = accumarray(idx,A); 1 + 3 + 6 = 10. ;-)

7 days ago | 0

| accepted

Answered
Find a series of consecutive numbers and change index of them
Data(:,1) = cumsum(diff([Data(1,2); Data(:,2)]) ~= 1); will change the first column to what you want. That's might be a bit "o...

7 days ago | 2

| accepted

Answered
while loop mixing number with word
Use a cell array instead: i = 1; a = 5; while (i<10) student{i} = a a=a+5; i = i+1 end See this Answers tuto...

7 days ago | 0

Answered
Loop not working properly
What you are observing seems correct to me. theta is 0, and phi is constant. This means that even as r increases y is zero (be...

8 days ago | 0

| accepted

Answered
My licensed Mathworks products (Home Use License )
Quoting from my R2019a Home license agreement: A Named User may install the Programs on up to four (4) different Computers but ...

9 days ago | 0

Answered
How to save Figures using "print" with a filename from a variable?
It's a straightforward extension of what you are doing now. For example k = 1; y = 1989; sprintf('/Users/Figure3/figCI_%d_%d....

10 days ago | 0

| accepted

Answered
Interpolation using scattered query points
I believe the solution you point to can be trivially vectorized: load clown ; imagesc(X); colormap gray ; [nx,ny] = size(X) ...

10 days ago | 0

| accepted

Answered
Finding max value in intervals
Given your nicely separated peaks, I think you could simply use the 'MinPeakDistance' name-value pair, as was done in this examp...

10 days ago | 0

Answered
Can the following function be optimized further for speed?
The vecnorm function probably does some error- and type-checking which you don't need, and you can combine two square root opera...

10 days ago | 1

| accepted

Answered
How to solve a 5x5 matrix in Matlab?
A\b Take a look at this documentation. Does that do what you want?

11 days ago | 0

Answered
Changing directories after a function is ran
Depending on exactly how you want to do it, I expect the following command will be useful: ls -- to see the folder contents in...

12 days ago | 0

Answered
Creating an Array for Different Radial Positions
theta = 0; phi = pi/2; r = 1 : 0.2 : 10; theta = repmat(theta,size(r)); phi = repmat(phi, size(r)); [x,y,z] = sph2...

12 days ago | 0

| accepted

Answered
How do I compare each value and take the average of same number of every comparison in a vector?
Will identical values every be separated from each other? If not, then it seems like you just need unique(A) But this will not...

13 days ago | 0

Answered
How to make a cell array of cell arrays
Here is one way: A = 1:70; C = cell(14,1); for ii = 1:14 C{ii} = A(5*ii-4:5*ii); end To be clear on terminology (...

13 days ago | 0

Answered
Find index in matrix
[tf,idx] = ismember([0 2 0],A,'rows') The output idx gives the row index. See ismember for details.

14 days ago | 0

Answered
Storing matrices value based on another matrix
Here is a straightforward algorithm: [M,N] = size(A); C = nan(max(sum(A,1)),N); for jj = 1:N row = 1; for ii = ...

16 days ago | 1

| accepted

Answered
Attempting to find patterns within my data
% The original data A = [ 8 1 2 2 4 4 5 2 1 6 1 3 1 1 1]...

17 days ago | 1

| accepted

Load more