Community Profile

# the cyclist

3,738 2011 年以降の合計貢献数

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

#### the cyclist's バッジ

すべて表示

Question on Plotting from Cell Array
% Parameters NCOORD = 3; NT = 1000; NOBJ = 10; MARKERSIZE = 72; % Pretend data C = cell(NT,NOBJ...

Error Message " grpstats requires Statistics and Machine Learning Toolbox"
The ver command will tell you the toolboxes you have installed, but they are not necessarily licensed. Try going to the license ...

2日 前 | 1

| 採用済み

using textscan to find the rest of the line after the specific expression...
The code I posted in your other question ... text=fileread(fileName); expr='(?<=Name = )\w*'; machineName=regexp(text, expr,'...

2日 前 | 0

how to use regexp to get the last characters of a line
Your definition of expr does not have a space between "Machine Name" and the equals sign, but your text example does. When I put...

3日 前 | 0

How to avoid for loop, when using ecdf for a matrix?
No. Inside the code for ecdf.m, you can see the line that explicitly creates an error message if the input is not a vector. I wo...

3日 前 | 0

| 採用済み

Taking middle 4 values of n size array
Here is one way, assuming the number of elements is even: % Input a = rand(1,8); numberElements = numel(a); numberToRemove...

4日 前 | 1

Taking middle 4 values of n size array
Here is one way, which will work for either even- or odd-length arrays. It is not efficient. % Input a = rand(1,9); whichEn...

4日 前 | 1

write a function that takes any equation as an input
Are you familiar with anonymous functions? That would presumably be the best way to pass "any function" as an argument. Then in...

4日 前 | 1

| 採用済み

linearly spacing a nX1 matrix
Your problem is still under-specified, and an infinite number of matrices will meet you conditions. Here is one possible solutio...

4日 前 | 0

| 採用済み

Find average y value of a range of numbers from a non linear data set
Your example of averaging the values from 6:10 would be mean(interp1(X,Y,6:10,"previous")) Change where I put 6:10 to be the a...

4日 前 | 1

| 採用済み

Index exceeds array bounds from CorrCoeff
The problem is that in the first iteration of your loop, you are taking the correlation of two scalar values: corrcoef(X(1,1),X...

5日 前 | 0

| 採用済み

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

5日 前 | 0

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

6日 前 | 0

| 採用済み

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

7日 前 | 0

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 ...

7日 前 | 0

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...

7日 前 | 0

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...

7日 前 | 0

| 採用済み

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 =...

9日 前 | 0

| 採用済み

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...

10日 前 | 1

| 採用済み

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...

10日 前 | 1

How to retrieve data from a website?

10日 前 | 0

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)...

11日 前 | 0

| 採用済み

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 ...

11日 前 | 1

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. ;-)

12日 前 | 0

| 採用済み

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...

12日 前 | 2

| 採用済み

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...

13日 前 | 0

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...

13日 前 | 0

| 採用済み

Quoting from my R2019a Home license agreement: A Named User may install the Programs on up to four (4) different Computers but ...

14日 前 | 0

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....

15日 前 | 0

| 採用済み

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) ...

15日 前 | 0

| 採用済み