回答済み
How to divide a column in table to other variables?
You need to specify the "GROUPINGVARIABLE" option, otherwise "...unstack treats the remaining variables as grouping variables. E...

3年以上 前 | 0

| 採用済み

回答済み
Convert multiple strings in a table to numbers
T = cell2table({"cat","1.2","","3.4";"in","4.5","6","7";"hat","","89",""}) T = convertvars(T,2:4,'double')

3年以上 前 | 0

| 採用済み

回答済み
I have 3 double array of sizes 6x1 double, 4x1 double and 5x1 double. I like to combine them to make a structure of size 1x3 struct containing all these 3 double arrays.
A = rand(6,1); B = rand(4,1); C = rand(5,1); S = struct('times',{A,B,C})

3年以上 前 | 0

| 採用済み

回答済み
How to create a time vector that is incremented between two datetime strings?
"But my t outputs only a single time rather than an vector. How can I resolve this?" Of course you can use the COLON operator (...

3年以上 前 | 0

回答済み
Save numbers (present within a cell) into a single matrix
S = load('example.mat'); C = S.example C(cellfun(@isempty,C)) = {0}; M = cell2mat(C)

3年以上 前 | 0

| 採用済み

回答済み
Multiply Constant Array by Another Cell Array
A = {(1:3).';(-1:2).'}; B = [2,3]; C = cellfun(@times,A,num2cell(B(:)), 'uni',0) C{:}

3年以上 前 | 1

| 採用済み

回答済み
Combine different size matrix
Works for any data sets, you just need to specify the column/row order of the matrices: C = {[1,1,1;1,1,1;1,1,1];[2,2,2;2,2,2];...

3年以上 前 | 2

| 採用済み

回答済み
How to extract Datetime string to separate columns of yyyy dd mm hh mm
That is a very unfortunate date format. Best avoided. T = readtable('ararat.txt', 'Format','%{yyyyddMMHHmm}D%f'); % ugh. T.Pro...

3年以上 前 | 2

| 採用済み

回答済み
Initialising tabular data structure using struct()
A simple REPMAT does the job: M = zeros(nL,mL); data = repmat(struct('at',M, 'bt',M, 'pt',M), NL,ML);

3年以上 前 | 0

| 採用済み

回答済み
Table referencing using cell
The simple MATLAB approach is to use the JOIN() family: data = table({'a';'b';'c';'c';'a';'b';'b'}, [3;4;6;8;3;5;4],'VariableNa...

3年以上 前 | 0

回答済み
How to add zeros in cell of string
The MATLAB approach: C = {'10';'00';'11';'011';'0101';'0100'} D = compose('%-08s',string(C))

3年以上 前 | 0

回答済み
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年以上 前 | 1

| 採用済み

回答済み
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年以上 前 | 0

回答済み
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年以上 前 | 0

回答済み
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年以上 前 | 1

| 採用済み

回答済み
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年以上 前 | 0

| 採用済み

回答済み
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年以上 前 | 0

| 採用済み

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

3年以上 前 | 0

回答済み
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年以上 前 | 0

| 採用済み

回答済み
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年以上 前 | 1

| 採用済み

回答済み
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年以上 前 | 0

| 採用済み

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

3年以上 前 | 0

| 採用済み

回答済み
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年以上 前 | 2

回答済み
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年以上 前 | 0

| 採用済み

回答済み
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年以上 前 | 0

回答済み
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年以上 前 | 1

回答済み
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年以上 前 | 1

| 採用済み

回答済み
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年以上 前 | 0

| 採用済み

回答済み
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年以上 前 | 1

| 採用済み

回答済み
Accessing field names in struct
test = struct(... 'a',false,... 'b',false,... 'c',false,... 'd',false,... 'e',false,... 'f',false...

3年以上 前 | 1

さらに読み込む