Answered
Subscript indices must either be real positive integers or logicals
You have created a variable in the workspace named MAX. You need to CLEAR that variable from the workspace, then try again.

3 years ago | 1

| accepted

Answered
Load data with .SPC extensions and certain name characteristics
S = dir('*abc.spc') then loop over the filenames as usual: https://www.mathworks.com/help/matlab/import_export/process-a-seque...

3 years ago | 0

Answered
Converting cell in double
Simpler and more efficient: S = load('ids.mat'); ids = S.ids Method one: robust indexing: X = cellfun(@isscalar,ids); V = z...

3 years ago | 0

Answered
Can I make readtable to be of single precision for numeric values?
"¿is there a way for me to make numeric variables/numeric input of readtable to be of single precison?" Two approaches to speci...

3 years ago | 1

| accepted

Answered
Functional programming: looking to create functions that map f(p1,p2,p3,...,pN,x) to g([p1 p2 p3 ... pN],x) and the reverse
Here are two wrapper functions: fpx_to_fpnx = @(fnh) @(varargin) fnh([varargin{1:end-1}],varargin{end}); fpnx_to_fpx = @(fnh) ...

3 years ago | 0

| accepted

Answered
how can I plot in a such a way the x axis is in interval 10 10E2 10E3 10E4.
Use SEMILOGX: Y = [0.266,0.267,0.280,0.340]; X = [1e1,1e2,1e3,1e4]; semilogx(X,Y)

3 years ago | 0

| accepted

Answered
How do I remove quotes from all values in a CSV data?
T = readtable('spam.csv')

3 years ago | 0

Answered
result in table format or excel format
cmdout = fileread('cmdout.txt') % fake data hdr = regexp(cmdout,'^\s*(\S+\s\S+)\s+(\S+)\s+(\S+)\s+(.*)','tokens','once'); tkn ...

3 years ago | 0

| accepted

Answered
Can we create submatrices of similar elements of matrix.
VS = {'v1','e1','v2','e3','v3','e4','v3','e5','v4'}; E = VS(startsWith(VS,'e')) V = VS(startsWith(VS,'v'))

3 years ago | 1

| accepted

Answered
how to find max value on matrix and mark it
A = [1,2,3;2,4,2;6,4,3]; B = A==max(A(:))

3 years ago | 0

| accepted

Answered
compensate vector into same length
The simplest approach is to download the function PADCAT() here: https://www.mathworks.com/matlabcentral/fileexchange/22909-pad...

3 years ago | 0

| accepted

Answered
How to solve 1.0000 not equal to 1 in MATLAB?
"How to solve 1.0000 not equal to 1 in MATLAB?" There is nothing to "solve", because 1.0000 is not equal to 1 (note the trailin...

3 years ago | 2

Answered
for loop multiple string replace
MATLAB is designed to work neatly and efficiently with arrays. Rather than doing things one-at-a-time like that, you should be u...

3 years ago | 0

| accepted

Answered
I couldn't understand the problem in this code.
Somehow you have managed to include NO BREAK SPACEs in the your code: https://www.unicodepedia.com/unicode/latin-1-supplement/a...

3 years ago | 0

Answered
How to change only one element in cell matrix and keep the rest elements constant?
"This is a complete 4-D matrix and I need to work with this matrix." Note that it is a 4D cell array, not a numeric array. Usi...

3 years ago | 1

Answered
Loading Files using a Loop with a predictable name pattern
P = 'absolute or relative path to where the files are saved'; N = 10; C = cell(1,N); for k = 1:N F = sprintf('IGP_Small_...

3 years ago | 1

| accepted

Answered
Creating a new cell array which is a subset of another cell array
D = Output; % preallocate for k = 1:numel(D) D{k} = Output{k}(C,:); end

3 years ago | 0

| accepted

Answered
Why my error handling function not working for multiple outputs?
"Why my error handling function not working for multiple outputs?" The problem has nothing to do with the two outputs, the prob...

3 years ago | 1

| accepted

Answered
Accessing field names in struct
test = struct(... 'a',false,... 'b',false,... 'c',false,... 'd',false,... 'e',false,... 'f',false...

3 years ago | 1

Answered
Converting an old Matlab code from 2011 to work with newest version
"I have very limited Matlab skills ..." Don't learn from that badly-written code. Use function handles! "This eval([method... ...

3 years ago | 1

| accepted

Answered
how to subtract the datetimes
ac = {'12/09/2022 04:28:01 PM'}; bc = {'12/09/2022 04:28:26 PM'}; at = datetime(ac, 'InputFormat','M/d/y h:m:s a') bt = datet...

3 years ago | 0

| accepted

Answered
savefigures with filenames from a cell array
You are already calling SPRINTF() to generate the filename, so just provide it with the text input too: vars = {'A','B','C','D'...

3 years ago | 1

| accepted

Answered
Hi,how do I merge .txt file date and time column?
This is easy and more efficient using the READTABLE() options: fnm = 'IMM2211.txt'; obj = detectImportOptions(fnm, 'NumVariabl...

3 years ago | 2

Answered
Splitting integers and floating values from a string in MATLAB
Here an approach which returns a table, which might be more useful for accessing your data: T = readtable('ex.txt', 'NumHeaderL...

3 years ago | 1

| accepted

Answered
How do I compare a cell array containing string arrays against a string array without using loops?
S = load('answersData.mat'); A = S.tableOfTextByTime.("tweetUniqueMentions") B = S.tableOfUsers{:,1} tic T = vertcat(A{:}); ...

3 years ago | 1

| accepted

Answered
How can i create cell array from matrix?
noP = 2; x_set = [50,44,0.03,0.13]; C = repmat({x_set},noP,1)

3 years ago | 0

| accepted

Answered
Dot indexing is not supported for variables of this type
IMAGES is a cell array, so you need to use curly braces to access its content: images{ii}.Neighborhood % ^ ^ TITLES is a...

3 years ago | 1

Answered
textscan different number of floating digits
"...but I need to order them according to the last part which is 30.0m 31.65m 33.5m" So why not just sort the filenames? That ...

3 years ago | 0

| accepted

Answered
Add string files to a cell array within a loop
Simpler using COMPOSE(): user = 'user'; runs = [1,2,3]; subj = 1; fmt = 'C:\\Users\\%s\\Documents\\BIDS__dataset\\sub-%02d\\...

3 years ago | 0

| accepted

Answered
How to extract date, month, year, and time from a table data?
The MATLAB approach is to use YMD() and TIMEOFDAY() and HOURS(): S = ["2016-01-01 00:30:00"; "2016-01-01 01:00:00"; "2016-01-01...

3 years ago | 0

Load more