Community Profile

photo

Stephen23


Active since 2014

Suspensa Vix Via Fit

Statistics

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

View badges

Content Feed

Answered
How to sorting categorical array for plotting
By default the categories are sorted into character order, not alphanumeric order. S = "M"+(1:10); A = categorical(S) C = cat...

16 hours ago | 0

| accepted

Answered
Select last numeric character(s) of the string
"How can I extract the last numbers occurring at the end of different strings?" X = "sucrose-10"; Y = str2double(regexp(X,'[-...

18 hours ago | 2

Answered
Compensate the vector with the last entry
V = [2,4,7,3]; K = 8; V(end+1:K) = V(end)

20 hours ago | 0

Answered
why the code is incorrect? and where is incorrect? Matlab told me the function is incorrect, why?
"why the code is incorrect?" FZERO expects its first input argument to be a function handle: /help/ma...

2 days ago | 0

Answered
find equal value into cell
Forget about loops and FIND and ISMEMBER and other fiddling around, you should be using OUTERJOIN command. If your data are nice...

3 days ago | 0

Submitted


Number to Words
Convert a numeric to a string with the English name of the number value (GB/IN/US).

4 days ago | 14 downloads |

Thumbnail

Submitted


Words to Number
Convert English number name/s written in a string to numeric value/s (GB/US).

4 days ago | 1 download |

Thumbnail

Answered
Using App Designer, reading a numeric edit field and creating a double array from the inputs?
The reason why it is a cell array is because you told MATLAB to make a cell array. Basically you are doing this: fc1 = 1; fc2 ...

4 days ago | 0

| accepted

Answered
Getting all values in the same field for different entries within a structure
"Is it possible to get all the different math grades in an array without a for-loop?" Of course. The simple and efficient MATL...

4 days ago | 0

Answered
How to change HH:mm:ss:SSS to HH:mm:ss.SSS for a column?
time = {'01:18:34:754'; '13:04:19:999'}; data = rand(2,1); T = table(time,data) tmp = regexprep(T.time,':(?=\d{3})','.'); T....

5 days ago | 0

Answered
error when using '>' , Operator '>' is not supported for operands of type 'table'.
if significant{i,j} > 2 % ^ ^ /help/matlab/matlab_prog/access-data-in-a-table.html

5 days ago | 0

Answered
Copy variables into excel smoothly
"So I wonder how I can work around this?" Don't copy-paste data into Excel. The simple, easy, robust approach is to use WRITEMA...

5 days ago | 1

| accepted

Answered
Fill a matrix with another buy keep the original size
A = zeros(5,5); B = rand(3,5); A(1:size(B,1),:) = B /help/matlab/getting-started-with-matlab.html

5 days ago | 1

| accepted

Answered
Adding to existing date value
"Using caldays does not update the month" Yes, it does: dt = datetime(2023,3,27, 'Format','u-MM-dd') dt = dt+caldays(5) Appa...

6 days ago | 0

Answered
Why is NaN returned when I have all necessary input data?
"Does anyone see my mistake?" Your data has a range of approx 0.166: how many peaks do you expect to get with minimum peak prom...

6 days ago | 0

Answered
How do I change the name of a variable (actually value of a character array) inside a loop?
"I do not see any oher solution then to edit the name while in the loop." What you are asking is just to change some text. This...

6 days ago | 0

| accepted

Answered
regexp string to numeric array
Assuming that every string contains exactly the same number of numeric data: str = {'bob22alice666buster2', 'donald42lisa00budd...

6 days ago | 0

Answered
finding a numeric pattern in a vector
Your basic concept is okay. You need to select an appropriate character match and quantifier. Note that the asterisk is actually...

6 days ago | 0

| accepted

Answered
Merging Date and time
Rather than fiddling after importing, the best approach is to import the file correctly using READTABLE options, e.g.: fnm = 'L...

6 days ago | 2

| accepted

Answered
Efficient way to convert m by n array into a single column table with each row containing n by 1 array?
A = [1 3 5; 2 6 7; 5 8 9; 3 2 1]; T = cell2table(num2cell(A.',1).')

7 days ago | 0

| accepted

Answered
Rearrange cell array of strings based on occurrence in another cell array of string
Assuming that every text in B contains exactly one text from A, and that every text in A occurs in B: A = {'test1', 'test2', 't...

8 days ago | 0

| accepted

Answered
I don't know how to use if function with or operator
The simple MATLAB approach: if any(data(i,1)==[0,0.0625,0.125,0.25,0.5,1,2,4,8,16,32]) or even simpler: if any(data(i,1)==[0,...

9 days ago | 2

Answered
readmatrix error: "filename" must be a string scalar or character vector.
Get rid of DIR from inside the loop. P = 'C:\Users\aasyuda\Documents\CV-EIS\aptamer-histamin\14April2023\14April2023\0p0001nM';...

9 days ago | 0

Answered
Writing txt files accurately with a restriction on the number of columns.
V = randi(123,1,23) T = sprintf('%g,',V); U = regexprep(T,'(.{1,13}),','$1\n'); % e.g. max 13 columns fprintf('%s',U) And if...

10 days ago | 2

Answered
How do I put spaces before a line in a txt file using strcat and fprintf?
STRCAT removes whitespace characters. The easy and robust approach is separate FPRINTF calls: fprintf(fid_wrt,' \n') fprintf...

10 days ago | 0

Answered
Generate comma separated list in single line of code?
A one-line approach that has been possible since R2019b: struct('x',{'A','B','C','D'}).x /help/releas...

11 days ago | 0

Answered
compare variable with different data types
Here is a neat approach that also allows case-insensitivity: x = 'Yes'; % x can be char, string, logical, or numerical if strc...

12 days ago | 0

| accepted

Answered
Concatenate all arrays from a field in a structure
Where S is your structure: A = vertcat(S.A) B = vertcat(S.B) etc. /matlabcentral/answers/1656435-tu...

13 days ago | 1

| accepted

Answered
Access and extract table array using for loop
"I need to extract (or access) the data using "for loop". For example, from "ECG", we can extract the data from 0 sec, 10 sec, 2...

13 days ago | 0

Answered
Merging empty vector with double
"if B is empty, I want it to be shown as 9 zeros" A = [1;2;3;4;5;6;7;8;9]; B = []; C = []; C(1:numel(A),1) = A; C(1:numel(B...

13 days ago | 0

| accepted

Load more