Community Profile

photo

Stephen23


Active since 2014

Suspensa Vix Via Fit

Professional Interests:

Statistics

All
  • Most Accepted 2021
  • Grand Master
  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • GitHub Submissions Level 3
  • First Submission
  • 36 Month Streak
  • Thankful Level 5
  • Revival Level 2
  • Knowledgeable Level 5

View badges

Content Feed

View by

Submitted


Maximally Distinct Color Generator
Generate maximally distinct colors in an RGB colormap.

1 jour ago | 32 downloads |

Thumbnail

Answered
Given a long (50-2000 each set in scientific notation ex. +1.394013E-10) string of multiple numbers, how can I convert it to an array quickly.
The very efficient approach is to use SSCANF: str = "+1.362134E-10,+1.381140E-10,+1.397078E-10,+1.401982E-10,+1.400756E-10,+1.4...

1 jour ago | 0

Answered
textscan to read date and time column and numeric data together
T = readtable('WHP-SEA-TP116-HS417-S1.csv', 'NumHeaderLines',66)

2 jours ago | 0

| accepted

Answered
Create Structure from cell array with dot separation in string
You can use SETFIELD() with a comma-separated list: V = pi; T = 'em1500.eta_t.x'; C = split(T,'.'); S = struct(); S = setfi...

3 jours ago | 0

| accepted

Answered
file list when "dir" to import data
"How can I make the "liste" to have the sequentially increasing number in the name?" If you cannot change the filenames to use ...

3 jours ago | 0

| accepted

Answered
How do i get multiple values all at once from cell array?
"... for loop(cause they are slow)" A well-written loop will be fast enough, e.g. where C is your cell array and assuming that ...

4 jours ago | 0

Answered
converting csv timestamp to datetime on import
type test.csv T = readtable('test.csv','Format','%{M/d/y}D%T%d','Delimiter',{',',' '}) D = T.Var1 + T.Var2 + milliseconds(T.Va...

4 jours ago | 0

| accepted

Answered
how to do the addition of the cell matrix ?
The simple and efficient MATLAB approach is to use SUM(): val = cat(3,[0,67.5000,0,67.5000,0;0,67.5000,0,67.5000,0],[79.3333,0,...

5 jours ago | 0

| accepted

Answered
Strange behaviour: struct with cell values
"Strange behaviour: struct with cell values" The STRUCT() documentation explains what happens with cell array inputs: "... if v...

6 jours ago | 0

| accepted

Answered
Sorting table row variables with number and letters
Your question and examples are confusing: sometimes you show that you want to sort RowNames, and sometimes that you want to sort...

8 jours ago | 0

Answered
Sort according to specific string contained in file name
S = ["D:\DATA\XY\Project_XY\label_sPR12345_AB67890-0011.nii"; "D:\DATA\XY\Project_XY\label_sPR40922_AB03091-0011.nii"; ...

9 jours ago | 0

Answered
Why am i getting this error 'unrecognized function or variable' for the defined function itself
clc % <---------- !!!!!!!!!!!!!!!!!! DELETE THIS LINE !!!!!!!!!!!!!!!! % <- and this line too function MM = po(conc,p,k) ...

10 jours ago | 1

Answered
How could I program a "for loop" in Matlab to calculate the function's minimum value?
X = [1,2,3,4,5]; Y = nan(size(X)); for k = 1:numel(X) b = X(k); G = @(x) x.^2 - b.*x + 1; Y(k) = fminbnd(G,0,10...

11 jours ago | 1

Answered
How to use "contains" statement to detect a string without ambiguity?
"Can you help me to solve this issue?" CONTAINS() check if the pattern occurs anywhere inside the string, but this could be a s...

11 jours ago | 0

| accepted

Answered
How to round numbers to specific near point?
A = [6.1;6.04;5.98;5.92;5.86;5.8;5.74;5.69;5.63;5.57;5.52;5.46;5.41] N = 0.05; B = round(A/N)*N

11 jours ago | 0

| accepted

Answered
What is the orthodox precedure of evaluating/determining the type of a distribution? And How to fit it into a normal distribution with skewness and kurtosis?
The standard appraoch is to use a quantile-quantile plot: https://en.wikipedia.org/wiki/Q%E2%80%93Q_plot which you can do in M...

11 jours ago | 0

Answered
Results of math with integer
"I tought using integer math tells that if we woukd result in a non integer result, the non integer part gets truncated:" What ...

11 jours ago | 0

| accepted

Answered
Multiple outputs from a for loop
Rather than distracting with anti-pattern numbered variables (like you asked about), instead you should just use basic, normal, ...

12 jours ago | 0

| accepted

Answered
Cell2mat with different rows
Download https://www.mathworks.com/matlabcentral/fileexchange/22909-padcat and use it like this: S = load('Cell.mat') A = S.A ...

12 jours ago | 1

| accepted

Answered
How to change each column of data in a matrix into a comma expression in an elegant and efficient way?
" I want to directly convert the above matrix A to table type" ARRAY2TABLE() "I can't find a function in matlab that can conve...

12 jours ago | 0

| accepted

Answered
Remove single quotes around numeric vector
"Do I have to use another function rather than sprintf?" Get rid of SPRINTF(), converting to character does not help you: Rang...

13 jours ago | 0

| accepted

Answered
MATLAB output is a bunch of numbers with operators not the exact number
double(A)

13 jours ago | 0

| accepted

Answered
Processing large matrix faster
Why are you using a loop? Use logical indexing: M = readmatrix('Bathymetry_Data.txt'); X = M(:,3)<(-80); coods = M(X,:);

13 jours ago | 0

| accepted

Answered
How to get original values from cumulative sum values?
X = rand(1,9) Y = cumsum(X) Z = [Y(1),diff(Y)] max(X-Z) % alomsot zero Because of the accumulated floating point error getti...

14 jours ago | 0

| accepted

Answered
"if sum" (how operator "sum" is possible next to "if"...?)
"Next to "if", there should be logic operator" The IF documentation actually states that it must be an expression. It also stat...

15 jours ago | 0

Answered
How can I add an index value to an array value?
M = [0.1,0.1,0.1,0.1;0.2,0.2,0.2,0.2;0.1,0.2,0.3,0.4] M = M + (1:size(M,2))

16 jours ago | 2

| accepted

Answered
All tables being vertically concatenated must have the same number of variables.
It is not clear to me why you want/need a table anyway. Why not simply concatenate that variable directly?: prm = 'DisplayLengt...

16 jours ago | 1

| accepted

Answered
How to load intermediate variable into workspace while using ode45 ?
Here is the neat, easy, robust approach which returns exactly the a values at the exact t and x output values: tspan = 1:100; ...

16 jours ago | 0

Answered
use eval to define a variable from table and a name stored as cell
EVAL is anti-pattern red-herring. Avoid EVAL. The actual solution is to use the methods shown in the MATLAB documentation: htt...

17 jours ago | 1

Answered
How the change the dimensions of multiple arrays with the cell, Matlab?
a = cellfun(@transpose,a,'uni',0)

17 jours ago | 0

| accepted

Load more