Community Profile

photo

the cyclist


3.800 total contributions since 2011

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

Contact

the cyclist's Badges

  • Scavenger Finisher
  • Thankful Level 4
  • 36 Month Streak
  • 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
Showing error Matrix dimensions must agree
The variable r has just two elements: [0 100]. theta has 16 elements: [0 6.2832 12.5664 18.8496 ...] What do you expect...

alrededor de 3 horas ago | 0

Answered
Add a row of zeros at the end of the matrix
output = [x' zeros(4,1)]; You can generalize this a bit by using the numel function to determine and use the size of x to get t...

alrededor de 23 horas ago | 0

Answered
How can i merge 2 cells with different items
I would solve this by trying to use different MATLAB data types more effectively: str(1).item = {5,4,zeros(1,5)}; str(2).item ...

alrededor de 24 horas ago | 0

Answered
Getting started with machine learning
I believe the answers to your questions are yes yes yes in that order. One possible starting point is MATLAB for Machine Lea...

1 día ago | 0

Answered
Cell to matrix average
I believe this does what you want: B = squeeze(mean(reshape(cell2mat(A),93,145,147,19)));

4 días ago | 0

Answered
Delete rows in intervall
If your vector is a multiple of 7 in length, then this will work: x = reshape(x,7,[]); x = x(1:4,:); x = x(:);

4 días ago | 0

Answered
Bin data in a strange way
% Simulate some data data = [0; 0; -10; -2766; -5600; -5535]; % Define bin centers binCenter = [ 0, -2765, -5530, -8295, -...

4 días ago | 0

| accepted

Answered
How to extract first non-zero element in each column and put into a new array
Here is one way: in=[0 0 6 0 0 5; 1 3 5 1 0 4; 4 4 5 3 4 5]; [m,n] = size(in); out = nan(1,n); for nc = 1:n ...

5 días ago | 0

Answered
How to extract first non-zero element in each column and put into a new array
Here is one way: in=[0 0 6 0 0 5; 1 3 5 1 0 4; 4 4 5 3 4 5]; mid = in; for nr = size(in,1)-1:-1:1 mid(nr,...

5 días ago | 0

Answered
How to extract first non-zero element in each column and put into a new array
Here is a one way: in=[0 0 6 0 0 5; 1 3 5 1 0 4; 4 4 5 3 4 5]; [m,n] = size(in); [i,j] = find(in); [~,jj] =...

5 días ago | 0

Answered
for loop to create a vector V of the squares
Because this is a very basic MATLAB question, and you don't even know how to start, I would recommending watching the MATLAB Onr...

5 días ago | 0

Answered
How do I determine which model fits my data the best?
The second output from the fit command gives goodness-of-fit statistics. You might also take a look at "Determing the Best Fit"...

5 días ago | 0

Answered
Plotting circles in a for loop using a time step
Your code runs fine for me, and creates a figure. What's the problem? What's your question? I'm going to take a stab at an answ...

5 días ago | 0

Answered
Find the cell index in a nested cell array, corresponding to a string (by using strcmp)
Here is a one-liner: cellfun(@(y)any(any(cellfun(@(x)isequal(x,{'BLUE'}),y))),A) I stumbled across this function for dealing w...

5 días ago | 0

Answered
sorting matrix in ascending order based on column 1 (and ascending order also for column 2)
Use the sortrows command. B = sortrows(A,1);

7 días ago | 0

| accepted

Answered
How do I create a 1x21 matrix where the inputs are all the different values of d
Does this code do what you had intended? (There was some guesswork on my part.) B=[1 2 3 4 5 6 7; 9 11 13 15 17 19 21]; Norm...

7 días ago | 0

| accepted

Answered
Reading through folders getting the warning : ." Index in position 1 exceeds array bounds (must not exceed 1).".
At some point, did you define a variable named dir? MATLAB would then try to access that variable, rather than the command. Clea...

7 días ago | 0

| accepted

Answered
Plotting within a nested for loop
I'm guessing you wanted something like plot(x2,y,'.') or possibly plot(x2,y)

8 días ago | 0

Answered
How can I count the largest number of repeated numbers in a double?
I recommend downloading the RunLength utility from the File Exchange.

8 días ago | 0

Answered
What is difference between isequal and == in comparing two vectors
isequal will return a single logical value, indicating whether or not the two vectors are identical. == will give a vector with...

8 días ago | 3

Answered
how to create a for loop 380:780?
I would use a cell array, not variable names that also encode an index: for ic = 380:780 CM4{ic} = spec_data(spec_data.wav...

8 días ago | 0

| accepted

Answered
What does this command mean?
I'm guessing it's this.

8 días ago | 0

Answered
Confidence interval in Linear Regression
I'm curious why you want to code them from scratch, but the formulas for the standard errors and confidence intervals for the sl...

8 días ago | 0

Answered
find possible combinations of each row of matrix and allocate their respective values into 2 different matrices
% The input data A = [0.3939 0.3116]; B = [1 16 17 6 9 0 0 0 0 0 0 0 0 0 1 16 17 6 7 8 10 0 0 0 0 0 0 0 ]; ...

9 días ago | 0

| accepted

Answered
Is it possible to draw a bar plot with percentage lines?
I'm not sure if you are asking for them to be automatically positioned, but there are many options for drawing lines on a plot: ...

9 días ago | 1

Answered
Having trouble getting legend to display properly
One possibility is to set the 'Visible' property of those axes to 'off'. Here is a simpler example ... figure plot(magic(3)) ...

9 días ago | 0

Answered
Refund on MatLab purchase
You should contact sales.

10 días ago | 2

Answered
How to shorten my data in the struct I have?
The problem is that you are trying to resize your variable "in place". You can't really do this in pieces. One solution would b...

10 días ago | 1

| accepted

Answered
Sensitivity-Specificity of clustering result (no labeled data)
I was really tempted to just write the one-word answer, "No". But, instead I'll say that I just don't see how it could be possi...

10 días ago | 0

Answered
how do I get the values of a matrix using movsum to add 90 consectuive cells in the matrix?
This task will be trivial if you use the RunLength utility from the File Exchange.

11 días ago | 0

| accepted

Load more