Community Profile # 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
• • • • • • • • • • • • #### Content Feed

View by

Linear regression fit model for Multi-variant responses
I think you need mvregress.

circa un'ora ago | 0

Plotting data against time
New answer based on your update. The problem is that your original time series is in two different formats -- not including the...

1 giorno ago | 0

| accepted

Plotting data against time
Works for me, when I correctly specify valid dates using the input format. I'm guessing that your datetime is somehow messed up...

1 giorno ago | 0

How do I display multiple num2str in a single row
I expect you'd be much better off using sprintf to format your output.

2 giorni ago | 0

Why am I receiving the error "Array indices must be positive integers or logical values."?
Here is a completely different tack, that I think is less confusing because you just defining the function I(z) more naturally a...

2 giorni ago | 0

| accepted

How can I make an exponential fit using two points of my data.
You can use the 'Weights' Name-Value pair, and heavily weight the first point. Here is a made-up example. Notice how f2 passes t...

3 giorni ago | 0

| accepted

Why am I receiving the error "Array indices must be positive integers or logical values."?
You have at least two problems with your code. First, you need an explicit multiplication sign in these lines: I(i) = I0*sin(k*...

3 giorni ago | 1

It's because the last three values of x and y are NaN. dataset=xlsread('Book1.xlsx', 'Sheet1'); tensile_stress = dataset(:,1);...

3 giorni ago | 1

Visualize a vector field function with matlab
x = -3 : 0.5 : 3; y = -3 : 0.5 : 3; z = -3 : 0.5 : 3; [xx,yy,zz] = meshgrid(x,y,z); Fx = xx.*zz; Fy = xx.*yy; Fz =...

4 giorni ago | 1

| accepted

hold on option is not working in the present code
The problem doesn't really have anything to do with the legend. The fundamental problem is that you first define L as a paramete...

5 giorni ago | 0

| accepted

delete specific rows in a table
I believe this does what you want. Note that this file doesn't have any repeated integer times. So, you don't need the second st...

5 giorni ago | 0

| accepted

How to access the equation above the while loop
One straightforward way to do this is by using an anonymous function: % Define an anonymous function for the limit f_limit = @...

5 giorni ago | 1

| accepted

Trying to make a code that tells the weather
You should be able to access a weather API (e.g. this free one), using the webread function.

6 giorni ago | 0

legend NumColumns not working in 2018a
It looks to me that the documentation states the change was in R2018b, not R2018a. As you can see, that code works fine here (R...

6 giorni ago | 0

| accepted

How to plot like the following figure?
I recommend looking at the MATLAB Plot Gallery, finding a figure that is close to what you need, and pulling the code from there...

6 giorni ago | 0

Transfering any point in PC space to original space
Borrowing the first few lines of code from my PCA tutorial ... rng 'default' M = 7; % Number of observations N = 5; % Number ...

6 giorni ago | 1

| accepted

How can I find the average of several lines whose datasets are different lengths?
One possible solution would be to interpolate (e.g. with spline function) using the interp1 function, to a common grid of points...

6 giorni ago | 0

Why do I receive "Index exceeds the number of array elements (1)" ?
m is a scalar -- the length of the vector x, plus one. You try to index into it as if it is a vector, for example in the expres...

7 giorni ago | 0

| accepted

Normalize unit vector to single didgit integers
Does the following do what you want? f = @(t) round(t/abs(min(t))); f([ 0.4 -0.4 0.8]) f([ 0.123 0.123 .5]) It gives a dif...

7 giorni ago | 0

VPA error Index exceeds number of array elements
I'm confused, because the code you posted runs fine: syms t P(t)= 30/(3+7*exp((-.03*t))) P(1960) vpa(P(1960)) Is it possibl...

7 giorni ago | 0

How can I solve this error?
When defining a function using that syntax, it has to appear inside a file, for example a text file with the name GRxx_P8_E1.m ...

7 giorni ago | 0

| accepted

How to plot binary matrix as dots?
M = magic(7); B = M > mean(M); colormap('gray') imagesc(B) axis square

7 giorni ago | 0

Interpolation of (multidimensional) array
So, this is a somewhat strange "interpolation" (and extrapolation) problem. It requires certain assumptions to leap from your da...

8 giorni ago | 0

| accepted

multiplication of empty 0X0 double and scalar (1X1)
One possible solution is to use a try-catch structure. The "try" block will be the code that is generally executed, but if that ...

8 giorni ago | 0

| accepted

operations on two different matrices
Suppose ... m = 3; n = 4; A = magic(m) B = magic(n) The first row of A is a 1x3 row vector, and the first row of B is a 1...

8 giorni ago | 0

Solved

The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

8 giorni ago

How to find correlations between a vector and a 3D array and plot the correlations spatially?
Is it correct that the result will be a 120x120 array of correlations, where each entry is the correlation of the 50 isotope val...

8 giorni ago | 1

| accepted

How to randomly change element of matrix?
I'll illustrate for an nxn where n = 3, and repeat 2 times: % Set the random number generator seed, for repeatability here rng...

8 giorni ago | 1

| accepted