Community Profile

photo

the cyclist


No strings on me

Last seen: Today Active since 2011

Obsessive runner. Flâneur. 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.)

Programming Languages:
Python
Spoken Languages:
English

Statistics

All
  • Treasure Hunt Participant
  • Scavenger Finisher
  • Master
  • Thankful Level 4
  • Likeable
  • Famous
  • First Review
  • First Submission
  • 36 Month Streak
  • Revival Level 3
  • Knowledgeable Level 4
  • First Answer

View badges

Content Feed

Answered
Histogram of overlaid standard normal draws
If you look carefully, you will notice that your bins are not at precisely the same locations. If you instead choose the exact b...

6 hours ago | 1

Answered
How do I sum the elements in a vector up to a specific value?
Here is one way: v = [2,3,2,2,1,3,1,10,3]; prize = sum(v(1:find(v==10,1)-1))

6 hours ago | 0

Answered
How to add iteration in a string (make multiple strings using iterations without indexing) ?
Here is one way: for i = 1:4 matlab = sprintf("png%d",i) end Here is another, but wanted to show the first way, which ca...

8 hours ago | 1

| accepted

Answered
Append rows to a starting row
It would be much easier for us to help if you uploaded your data file your code (instead of an image of your code) However, i...

10 hours ago | 0

| accepted

Answered
Obtaining a logic vector (?) from a logic array
A = [0 0 0 0; 1 0 0 0; 1 1 0 1; 0 0 0 0; 0 1 1 0]; v = any(A,2)

18 hours ago | 0

| accepted

Answered
I want to generate a matrix of random numbers between 0 and 2.5 with length=8 and the sum of generated numbers be 20
Use the Random Numbers with Fixed Sum submission from the File Exchange.

2 days ago | 0

Answered
Exclude certain dates on x-axis using xlim or xtick?
One possible solution to this would be to use a tiledlayout to plot each day in its own subplot.

3 days ago | 0

| accepted

Answered
How to combine multiple plots using subplot?
Prior subplots that would be overlapped by later plots are deleted. Try this simple on your local machine. figure subplot(3,1,...

5 days ago | 0

Answered
write p-value into plot
You can use the text or annotation functions. The text function is easier, but the annotation function is more powerful.

6 days ago | 0

| accepted

Answered
Non linear regression: Matlab function similar to Excel solver ???
This very old question/answer from the Mathworks Support Team indicates that there is no MATLAB function for the generalized red...

6 days ago | 0

Answered
Show free variables in solution(s) instead of zeros
A numeric matrix in MATLAB cannot hold an "x". You could change them to NaN: % Your solution M = [0, 0, 90.0, 0, 0, 0; ...

6 days ago | 0

Answered
Predictions Logistic Regression model using fitglm
I have a couple of comments, before answering your specific questions. First, you might benefit by reading up a little bit on g...

7 days ago | 0

Answered
Turning a char element in a double array
a = char('[21,12,43,1]'); array_convert = str2num(a)

7 days ago | 0

Answered
How to replace only one instance in a certain string
If you are certain that the first e is the first character of the string, then this will do it: x = 'e-8.5e-5' y = regexprep(x...

7 days ago | 0

| accepted

Answered
read data of 3 dimensional matrix
% Some pretend data data = rand(129, 135, 365); % Max along 3rd dimension max3 = max(data,[],3); % Display size of max3 ...

7 days ago | 0

| accepted

Answered
Is there any more efficient way to split a table than this
% Set random seed for reproducibility rng default % Make up a table with pretend data N = 30; x = rand(N,1); solar = 200*...

7 days ago | 0

Answered
Plotting y1 and y2 versus time in the same graph with same axis level but both in the same side and different y axis name.
Not sure what you mean about "mentioning both speeds in y axis". A more conventional method would be to use a legned. Does this ...

7 days ago | 1

Answered
How to create animation of multiple of frames using for loop ?
I believe you can do what you want by using the getframe and movie functions.

7 days ago | 0

| accepted

Answered
Remake this without a loop
% Pretend data A = 1 : 7; vector = [2 3 5]; % Replace values of A with 0, if they are in vector A(ismember(A,vector)) = 0

8 days ago | 1

| accepted

Answered
I have been working on this code. But it's kept showing me this error. Please help me
How are you trying to run that code? If you just try to run those lines from the Command Window, it will give that error. The r...

8 days ago | 0

Answered
Get next business day without taking into account holidays and saturdays
The issue is not a problem with busdate(), but with your understanding of the input. 20170610 is being interpreted as a serial d...

8 days ago | 1

| accepted

Answered
Using a GLM model to predict the response factor from a fixed factor
I'm very confused about how you have coded the model. Specifically, The first input to fitglm should be the predictor variable,...

10 days ago | 0

| accepted

Answered
Turning an entire script into a function
Put this code into a file named battleship.m function [] = battleship() clear all close all clc rowdim=input('give me...

10 days ago | 0

Answered
kstest for uniform distribution
From the documentation: "The one-sample Kolmogorov-Smirnov test is only valid for continuous cumulative distribution functions."...

12 days ago | 0

Answered
Using Linear Mixed Models with two fixed factors and a random factor
You can fit such a model using the fitlme function from the Statistics and Machine Learning Toolbox. I think the following code...

14 days ago | 1

| accepted

Answered
How to find area under curve
I did not open your text file, but assuming you got that plot using plot(x,y) then it should be as easy as trapz(x,y)

17 days ago | 0

| accepted

Answered
How to bin IDX based on previous IDX value?
Is this what you mean? a = [0 0 1 2 2 1 2 2 1 0 1 0 2]; loc2 = a(2:end)==2; pre = a(1:end-1); b = 1 + find(loc2 & (pre=...

18 days ago | 0

Answered
how do we make vector the same length ( i get the error: vector must be the same length)
I think you intended elementwise division. See the documentation for array vs. matrix operations. x=linspace(0,100); y=linspac...

18 days ago | 0

Answered
I have this code in matlab but it does not work alone. I think I need a script for it.
Works for me. Here is an example f = @(x) x.^2 - 1; df = @(x) 2*x; Newton_method(f,df,3,1.e-6,500) function x = Newton_...

19 days ago | 0

Load more