Community Profile

photo

Stephen Cobeldick


Last seen: Today
7,308 total contributions since 2014

Suspensa Vix Via Fit

Stephen Cobeldick's Badges

  • 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 4
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
Why 'PreserveFormat' in writetable returns error?
The 'PreserveFormat' option was added in R2020b: https://www.mathworks.com/help/matlab/release-notes.html?rntext=PreserveFormat...

1 day ago | 0

| accepted

Answered
Using matfile to partially extra data still loads entire file into memory
Transpose the cell array (when it is created), so that you are accessing a contiguous part of the cell array: Data = obj.CellAr...

1 day ago | 0

Answered
How to make textscan robust against non-matching lines?
str = fileread('data.txt'); tkn = regexp(str,'#HELLOMATHWORKS,([^,]+),(\S+)','tokens'); tkn = vertcat(tkn{:}) vec = str2doubl...

2 days ago | 0

| accepted

Answered
How to import several csv files (Nan,numeric,text) for operate with them after
"I want the cells to be rename because I want to know to which station corresponds the data in each cell. As you can see I could...

2 days ago | 1

Answered
Conversion to double from function_handle is not possible message
You define ome1, ome2, and ome12 as functions of 1 or 2 input arguments, but in some cases you do not call their function handle...

2 days ago | 0

| accepted

Answered
Extracting rows from table with specific digits
I changed your example data so that the first code string contains '2' but not in the 2nd position, to make a more thorough test...

2 days ago | 0

Answered
Assignment of variables by comma separated lists
"Why is that?" The answer is surprisingly simple: the explicit syntax X,Y,Z is considered as three separate evaluations, much...

3 days ago | 0

| accepted

Answered
How to delete certain strings with chaning numbers in a big data set
tmp = sprintf("page %d of 600",i); data_new4~=tmp Or ~strcmpi(data_new4,tmp) Note that you will want to replace the previous...

3 days ago | 0

Answered
Kilobytes to bytes conversion
The SI system defines "kilo". The SI definition of "kilo" means 1000, and has never defined it to mean 1024. Here are the SI pr...

3 days ago | 1

| accepted

Answered
how can partition a vector into smaller sub sequences
A = 1:19; N = [3,5,7]; S = mat2cell(A(1:sum(N)),1,N) Or V = cumsum([0,N]); F = @(b,e)A(1+b:e); S = arrayfun(F,V(1:end-1),V...

3 days ago | 0

| accepted

Answered
How to find a number but if it repeats immediately after, take the first value.
A = [0 5 0 5 5 0 0 0 5 5 5 5 5 0 0 0]; X = diff([false,A==5])>0

3 days ago | 0

| accepted

Answered
Accessing the values of a cell array stored in a table to make a new variable
Var1 = [true;false]; Var2 = [true;true]; c = {ones(1000,1);zeros(1000,1)}; T = table(Var1,Var2,c) T.v = cellfun(@(v)v(1),T.c...

3 days ago | 0

| accepted

Answered
cell array in cell array
If you really want to use inconvenient nested cell arrays, this will work with your example data: b = [a{:}]; b = [b{3,:}] ht...

4 days ago | 1

| accepted

Answered
Assigning columns of matrix to strings.
Naming variables dynamically is one way that beginners force themselves into writing slow, complex, buggy code: https://www.mat...

4 days ago | 1

| accepted

Answered
How to feed additional variables into fsolve function
https://www.mathworks.com/help/optim/ug/passing-extra-parameters.html dv = [3610.30,2040.80,1203.70,483.04,106.03,15.54,3.39,1....

7 days ago | 1

| accepted

Answered
How do you enforce Element-wise operations in function handles?
There is no trivial answer to this. Fundamentally your request involves swapping operators, just as if you requested to replace ...

8 days ago | 0

Answered
remove the first 2 char of a string
What you show is a character vector, not a string. Which makes this easy using indexing: c = ',''B132-32'',''B134-22'',''S132-1...

9 days ago | 0

| accepted

Answered
How do I check if all numbers in a vector are the same?
all(diff(A)==0) min(A)==max(A) % does not work for NaN range(A)==0 % RANGE requires the statistics toolbox numel(unique(A))==...

9 days ago | 1

| accepted

Answered
convert Vector into matrix ?
A = [1,2,3,4,5]; B = hankel(A(1:3),A(3:5))

10 days ago | 0

Answered
Sort a table with different orders for different columns
Where T is your table: sortrows(T,[1,2,-3])

10 days ago | 1

| accepted

Answered
How to construct indicator function in array function?
I don't see why you need arrayfun: f = [2;3;4]; g = [2.5;4;8]; fun = @(x) x>=f & x<=g; fun(2.1) fun(4) % your example is in...

10 days ago | 0

| accepted

Answered
Combining two character arrays so that the elements of one of them is added in between the elements of the other one
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; a = 'AAAAAAAAAAAAAAAAAAAAAAAAAA'; out = reshape([a;x],1,[])

10 days ago | 1

| accepted

Answered
How do I call functions with names generated by str2func, varargin, and input argument blocks?
function callTagFunction(tag,varargin) myFunction=str2func(tag); if nargin ==1 myFunction(); else myFunction(vararg...

11 days ago | 0

| accepted

Answered
fprintf parse error, invalid matlab syntax
fprintf(N_file,'G01 X%1.6f Y%1.6f C%1.0f B360;\n', -i*s, sqrt(r^2-(-i*s)^2)-r),newt); % ...

11 days ago | 0

| accepted

Answered
Refer to structure names
F = fieldnames(A); B.(F{1}) = table1 B.(F{2}) = table2 https://www.mathworks.com/help/matlab/matlab_prog/generate-field-names...

11 days ago | 1

| accepted

Answered
Extracting number from a string
str = 'TotalPower:9,7406E+00Watts'; num = sscanf(strrep(str,',','.'),'%*[^:]:%f')

11 days ago | 0

| accepted

Answered
Error in for loop calculation
You are confusing data with indices. Do not use data as indices. temperature = 212 ; % temperature in deg F oilapi = 41 ; % oi...

11 days ago | 0

| accepted

Answered
how to extract all columns in between two variable names (column header) of a table?
Age = [38;43;38;40;49]; Smoker = logical([1;0;1;0;1]); Height = [71;69;64;67;64]; Weight = [176;163;131;133;119]; T = table(...

12 days ago | 0

| accepted

Answered
storing matrix elements in a single variable as string
A = [3,25,100,5,20,100]; S = compose("%d#%d@%d",A)

12 days ago | 1

Answered
Cell array to text form
I suspect that you are confusing how data are stored with how they are defined and displayed, but anyway: C = {'L1125';'Y8898';...

12 days ago | 0

Load more