Function is not reading input from main script
You need to parameterize your function calls: https://www.mathworks.com/help/matlab/math/parameterizing-functions.html You nee...

14 jours ago | 0

| accepted

'combnk' enumeration of combinations
>> [X,Y,Z] = ndgrid([-1,0,1]); >> M = [Z(:),Y(:),X(:)] M = -1 -1 -1 -1 -1 0 -1 -1 1 -1 0 -1 -1 0 ...

15 jours ago | 0

| accepted

Problem with if-elseif when conditions contain several strings
"So I don't need a solution, but an explanation, why this occurs..." The first thing to do when trying to understand what your ...

15 jours ago | 1

| accepted

How to read a specific number in a text file containing a mixture of strings and numbers?
The regular expression doesn't need to be so complex: >> chr = webread('http://tgftp.nws.noaa.gov/data/observations/metar/decod...

15 jours ago | 0

How to load multiple specified variables in a specified mat file？
Your code does not make much sense: you added single quotes around the variable name (making it a literal string), you removed t...

15 jours ago | 0

If B is a matrix,what is the difference between B(1:end) and B(:)
Given a matrix B: B(1:end) uses linear indexing. The size of the output is the same as the size of the index (which in your exa...

16 jours ago | 2

| accepted

Variables accessible in unrelated files?
"Can someone explain to me how this is possible..." Because you have written scripts. Scripts share the same workspace that the...

16 jours ago | 0

How to extract elements form a vector in order to create an unknown number of sub-vectors?
Here is one simple approach based on diff, cumsum, and accumarray: >> M = [2.24;2.28;2.31;0.99;1.44;1.44;1.44;1.44;2.12;2.25;2....

16 jours ago | 1

| accepted

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

17 jours ago | 3

| accepted

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 ...

19 jours ago | 1

| accepted

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...

19 jours ago | 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://...

20 jours ago | 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' '...

20 jours ago | 0

| accepted

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...

20 jours ago | 1

| accepted

how to create new folder ?

21 jours ago | 0

Check if file exists (without having the full name)

21 jours ago | 0

mkdir and simulations problems

21 jours ago | 1

| accepted

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...

21 jours ago | 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...

21 jours ago | 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...

21 jours ago | 0

| accepted

Submitted

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

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 ...

21 jours ago | 1

| accepted

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...

22 jours ago | 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 ...

22 jours ago | 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...

23 jours ago | 0

| accepted

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

23 jours ago | 2

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

24 jours ago | 0

| accepted

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 ...

24 jours ago | 3

| accepted

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...

25 jours ago | 0

| accepted