답변 있음
Extracting strings between different characters from a cell array without loop
>> C = {'LS=Students201509DS=Teachers201509CS=ConfigVS=English]' 'LS=Preschoolers201801DS=Students201910CS=AbsVS=Italian]' ...

14일 전 | 3

| 수락됨

답변 있음
how to determine the relative position of a number in a matrix
>> M = [1 0 0 0 % valid 1 0 0 1 % valid 1 0 0 -1 % valid 1 0 -1 0 % valid ...

15일 전 | 1

| 수락됨

답변 있음
Convert a vector to vector sequentially?
>> init = [1 2 3 4] >> final = [5 6 7 8] >> X = triu(ones(5,4)); >> M = init.*X + final.*~X M = 1 2 3 4 5 2...

16일 전 | 1

답변 있음
Loop function over multiple subfolders within one root folder?
The MATLAB documentation shows you can either obtain the names (i.e. using dir) or generate them (e.g. using sprintf): https://...

17일 전 | 0

답변 있음
turning date strings to overal minutes
Just use datetime, e.g.: >> C = {... '2019_12_31_17_43_31.39-Isd' '2019_12_31_17_19_36.39-Ig' '2019_12_31_16_55_41.38-Ig' '...

17일 전 | 0

| 수락됨

답변 있음
Efficient way of finding numbers from one matrix in another, not using for loops
Your code's slowness is partly due to the fact that you are expanding the output array ElementNodes on each loop iteration: this...

17일 전 | 1

| 수락됨

답변 있음
how to create new folder ?

18일 전 | 0

답변 있음
Check if file exists (without having the full name)

18일 전 | 0

답변 있음
mkdir and simulations problems

18일 전 | 1

| 수락됨

답변 있음
I have a script file which simply saves some variable into a .txt file format.But now i want that everytime i run the script,it must save .txt file with different name.Please help.
You could download my FEX submission nextname. Each time the script runs generate a new filename like this: name = nextname('hi...

18일 전 | 0

답변 있음
Save multiple run result of script
An alternative to using a loop: download my FEX submission nextname, which will generate the next name each time you call it. Si...

18일 전 | 1

답변 있음
How do I create a new folder each time I run a code?
There are two problems with your code: You are not passing nextname the path of that location, so instead of looking in the loc...

18일 전 | 0

| 수락됨

제출됨

Next Available Filename
Returns the next unused file or folder name. The name is created by incrementing a numbered suffix.

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

답변 있음
How determined lowest value in cell?
For some reason you want to get the number of rows but in your code you check the number of columns. Also your input to cellfun ...

18일 전 | 1

| 수락됨

답변 있음
TUTORIAL: Why Variables Should Not Be Named Dynamically (eval)
Buggy Using eval makes it really hard to track down bugs, because it obfuscates the code and disables lots of code helper tools...

19일 전 | 6

답변 있음
how can i create this matrix
>> [I,J] = ndgrid(1:7,1:8); >> X = I>J; >> M = (2+2*~X).*J.*X - 2.*~X.*I - X M = -2 -2 -2 -2 -2 -2 -2 -2 ...

19일 전 | 0

답변 있음
set difference between two cell arrays
>> A = {2,[2,3]}; >> B = {2,3}; >> [XA,XB] = ndgrid(1:numel(A),1:numel(B)); >> X = arrayfun(@(xA,xB)isequal(A{xA},B{xB}),XA,X...

19일 전 | 0

| 수락됨

답변 있음
How to say concatenate from string 2 to end?
V = ["A","B","C","D"] W = join(V(2:end),"-")

20일 전 | 2

답변 있음
convert string to cell
If the inputs are scalar strings use + to append them together: equation{a} = Parameters(a) + "=" + a0 + "+" + a1 + "+" + a2; ...

21일 전 | 0

| 수락됨

답변 있음
regexp: what am I missing from the documentation?
A direct interpretation of your description "assume that all name instances in a character vector test have one of two possible ...

21일 전 | 3

| 수락됨

답변 있음
how to load multiple text files in nested folder?
Probably the sprintf method does what you need: https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files...

22일 전 | 0

| 수락됨

답변 있음
What is the meaning of ~ at fuction?
MATLAB has positional function input and output arguments. This means their purpose is determined entirely by their position whe...

23일 전 | 2

| 수락됨

답변 있음
Extracting values from a cell array into new arrays
Step 1: indexing: D = C(b(:,1)); Step 2: cellfun and an anonymous function: F = @(m,v)m(m(:,2)==v,:); Z = cellfun(F,D(:),num...

23일 전 | 0

답변 있음
How do I read only a specific lines from txt file and store as array?
This is easy and efficient with textscan: opt = {'HeaderLines',17,'CollectOutput',true}; fmt = repmat('%f',1,5); [fid,msg] = ...

23일 전 | 2

| 수락됨

답변 있음
How would I create a matrix from the following strings
Note that specifying a suitable format string is much more efficient than importing as character/string and then converting afte...

23일 전 | 2

답변 있음
extract an array from cell with its indexes
>> clstr = {[],8,[7,8],[6,8],[6,7],[6,7,8],5,4,[4,8],[4,7,8],[4,6,7],[4,6,7,8],[4,5],[4,5,8],[4,5,7]}; >> ter = [4,5]; >> id...

23일 전 | 0

| 수락됨

답변 있음
Merging Arrays in a Struct and Sorting them
A more robust solution, where v is your 2x1 structure: out = sort([v.IndividualStiffnessMatrix]) Note that your field name is ...

23일 전 | 0

답변 있음
How to save the several results of a program in an array?
Assuming that those means are scalar values, then a simple loop: dV = [10,20,30,40,50]; nV = numel(dV); averf6 = nan(1,nV); ...

27일 전 | 1

| 수락됨

제출됨

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

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

답변 있음
How can I repeat the values of an array in the same order?
>> W = [1,2,3,4,5]; >> W2 = repmat(W,1,3) W2 = 1 2 3 4 5 1 2 3 4 5 1 2 3...

28일 전 | 1

| 수락됨