Community Profile

photo

Stephen


2014 이후 활성

Suspensa Vix Via Fit

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

배지보기

Content Feed

보기 기준

답변 있음
How do I convert a 2d matrix to a 3d matrix and vice versa efficiently?
format compact A(:,:,1) = [1,2;3,4;5,6]'; A(:,:,2) = [10,20;30,40;50,60]'; A(:,:,3) = [11,21;31,41;51,61]'; A(:,:,4) = [100,...

약 19시간 전 | 0

| 수락됨

제출됨


Numeric to Ordinal-String
Convert numeric values to a string array of integers with ordinal suffixes. Fully vectorized!

1일 전 | 다운로드 수: 2 |

Thumbnail

제출됨


Number to Yllion
Convert a number to text giving the value using Donald Knuth's Yllion naming scheme.

1일 전 | 다운로드 수: 1 |

Thumbnail

답변 있음
How to find the index of the minimum value in a matrix.
Where M is your matrix: [R,C] = find(M==min(M(:))) or [~,X] = min(M(:)); % or [~,X] = min(M,[],'all','linear'); [R,C] = ind2...

3일 전 | 1

답변 있음
Get all unique combinations of 2 columns from a table
V = {'Item1','Item2','Item3','Item4'}; T = table(1, 5, 7 ,10, 'VariableNames',V) X = nchoosek(1:numel(V),2); D = diff(T{:,V}(...

3일 전 | 1

| 수락됨

답변 있음
How do I transform this format 202007011030 (2020 07 01 10:30) into a readabel format?
You can easily import as DATETIME, no need to import as text nor fiddle around with text: fid = fopen('Fehmarn_Wind_date.txt','...

3일 전 | 0

| 수락됨

답변 있음
How to create a 3D matrix from subtracting 2D matrices (like creating 2D matrix from subtracting vectors)?
C = permute(A,[1,3,2]) - permute(B,[3,2,1])

3일 전 | 1

| 수락됨

답변 있음
Reading text file data with different data formats
Move the "header" to the top: txt = fileread('sample test data.txt'); [hdr,spl] = regexp(txt,'^#[^\n]+','match','split','linea...

3일 전 | 1

답변 있음
Use of assignment '=' in plot command?
That name-value sytnax was introduced in R2021a: y=1:10; plot(y,'.-',linewidth=2) % ^^^^^^^^^^^ this syntax introdu...

4일 전 | 0

| 수락됨

답변 있음
Write sections of a long string as new lines in a text document
sub = 'XYZYXYZYZYZXYZYXYZ0XYXYXYX'; tmp = split(sub,'0'); fprintf('%s\n',tmp{:})

4일 전 | 0

| 수락됨

답변 있음
How to save a matrix data with a concatenated variable name?
It is simpler and more efficient to use a structure: C = {'PrimSpeed','SecSpeed'}; S = struct(); for k = 1:numel(C) ...

5일 전 | 0

| 수락됨

답변 있음
Find corresponding element in same row as given value in matrix
Assuming that A and B are you matrices, and that the Y values are in the second columns: [valA,idx] = max(A(:,2)) valB = B(idx...

7일 전 | 0

| 수락됨

답변 있음
What is the best practice to recursively extract data from a nested structure in matlab?
S=struct(); S.case='1'; S.type='A'; S.values.model1.case='2'; S.values.model1.type='C'; S.values.model1.values.mission.case...

10일 전 | 0

| 수락됨

답변 있음
Identifying numbers within a long string containing multiple occurrences of text and numbers in one row
Simpler and gives the requested output: str = 'x y z p (Pa)...

10일 전 | 0

| 수락됨

답변 있음
Read CSV with yyyyMMddhhmmss and group months
Here is one way to group by month only, ignoring empty lines of the CSV file: str = fileread('sample.csv'); tkn = regexp(str,'...

11일 전 | 0

| 수락됨

답변 있음
using mat2cell
Using NUM2CELL would be simpler: C = num2cell(M,1) But if you insist on using MAT2CELL: C = mat2cell(M,1001,ones(1,10))

11일 전 | 0

답변 있음
how can i negative all value in a matrix except diagonal?
M = [13.333,5,0,5,3.3333,0;5,27.333,4,10,3.3333,5;0,4,17.846,0,3.8462,10;5,10,0,17.5,2.5,0;3.3333,3.3333,3.8462,2.5,16.346,3.333...

11일 전 | 1

| 수락됨

답변 있음
How to unfold/concatenate a 3D Matrix?
Making some guesses about the order you want, where A is your array: B = reshape(permute(A,[1,3,2]),[],21)

12일 전 | 0

| 수락됨

제출됨


Customizable Natural-Order Sort
Alphanumeric sort of a cell/string/categorical array, with customizable number format.

12일 전 | 다운로드 수: 29 |

Thumbnail

제출됨


Natural-Order Filename Sort
Alphanumeric sort of filenames or filepaths, with customizable number format.

12일 전 | 다운로드 수: 264 |

Thumbnail

제출됨


Natural-Order Row Sort
Alphanumeric row sort of a cell/string/categorical/table array, with customizable number format.

12일 전 | 다운로드 수: 24 |

Thumbnail

답변 있음
Problem in properly creating a structure to store data
The simple and efficient approach: P = 'absolute or relative path to where the files are saved'; S = dir(fullfile(P,'*.txt'));...

12일 전 | 0

| 수락됨

답변 있음
Count number of unique .mat files in a folder
The simple MATLAB approach is to use one of the histogram functions rather than a loop, e.g.: % S = dir(fullfile(rootPath,'**',...

12일 전 | 0

답변 있음
how to know if cell has some empty values
Where C is your cell array: any(cellfun(@isempty,C(:,3)))

12일 전 | 1

| 수락됨

답변 있음
Find index of value extracted from subset in larger set
The simple MATLAB approach is to use indexing: X = 325:400; [p,Y] = min(pvalue(X)); t = tvalue(X(Y));

14일 전 | 0

| 수락됨

답변 있음
How to use regexp in a cell array whose cells may contain cell entries
Your data: S = load('model.subSystems.mat'); model = S.model; Getting indices of nested cells which contain the requested tex...

14일 전 | 0

| 수락됨

답변 있음
How can I create structure entries in a for loop.?
Using a cell array and a structure array: C = {data1,data2,data3}; for k = 1:numel(C) S(k).max = max(C{k}); S(k).min...

14일 전 | 0

| 수락됨

답변 있음
elseif when the flag is not true
" I wanted the else condition to happen only when count1==5*N and the flag condition was not respected." Make the code explicit...

15일 전 | 1

| 수락됨

답변 있음
colon operator returns different answer in command window and script
"colon operator returns different answer in command window and script" Yes, because you called COLON with different values. "W...

15일 전 | 1

답변 있음
Removing certain type of repeating cell
A direct, intuitive, and reasonably efficient approach is to simply check the existing cell array content: out = Conc(5) fun...

16일 전 | 0

| 수락됨

더로드