回答済み
I have it reading from a struct with signal names and I want to extract it and input it into a 1 column array
The solution depends on the sizes of MESSAGES and SIGNALINFO (you did not tell us either of these). Perhaps this: out = {Messa...

3年弱 前 | 0

回答済み
How to call a MATLAB variable loaded in from a .mat file when you don't know the name of the variable beforehand
"The easiest way would be to use eval():" Use STRUCT2CELL, e.g.: C = struct2cell(load(filename)); D = C{1}; Avoid LOADing di...

3年弱 前 | 0

| 採用済み

回答済み
Why Does Format of Data Returned from readtable() Depend on Import Options that are Not VariableTypes?
"Is that expected behavior?" Yes. Or at least, not really very surprising. "Why Does Format of Data Returned from readtable()...

3年弱 前 | 0

| 採用済み

回答済み
Find peaks in a matrix containing zeros
A = [1,3,-1,1,5,-1,0;1,6,3,-2,0,0,0;2,3,9,-2,1,11,-1;4,1,-2,8,5,0,0;2,-2,6,-1,0,0,0;-1,13,-2,0,0,0,0] F = @(a)findpeaks(a,'Thre...

3年弱 前 | 2

| 採用済み

回答済み
Plotting perpendicular lines but they are not perpendicular.
"But as you can see these do not show up as perpendicular." They are perpendicular: check the axes scales! If you want the X a...

3年弱 前 | 1

| 採用済み

回答済み
Swap shape of cell array full of arrays
C = {[1,2,3,4,5], [1,2,3,4,5]; [1,2,3,4,5], [1,2,3,4,5]} F = @(a)reshape(a,1,1,[]); D = reshape(num2cell(cell2mat(cellfun(F,C,...

3年弱 前 | 0

| 採用済み

回答済み
How to save current time in file name
You are trying to concatenate STRINGS... and that gives you STRING array with multiple elements, not a character vector nor a sc...

3年弱 前 | 1

| 採用済み

回答済み
Find the 137th character in a file?
fnm = 'theNameOfYourFile.txt'; txt = fileread(fnm); txt(137)

3年弱 前 | 2

回答済み
add internal parts of a vector
A = [1;1;1;1;1;3;4;8;1;1;1;2;9;1;1;1;1;4;1;1] X = A==1; Y = cumsum([1;diff(X)>0]); Z = accumarray(Y,X)

3年弱 前 | 2

回答済み
error using system -- "Command argument must be either a nonmissing scalar string or a character row vector. "
"it seems the syntax of the assembled path/file to run is incorrect" True, it is a 1x6 string array. "but I don't know what it...

3年弱 前 | 2

| 採用済み

回答済み
interp3 problem: the value of the last sampling coordinate is not match.
"Any insights or suggestions on how to correctly interpolate the profile between p1 and p2 would be greatly appreciated." You a...

3年弱 前 | 1

回答済み
Updating Structure Input for Functions
Do not use nested structures. Definitely do NOT use lots of variables each named after a fruit! Ugh, no. Use a structure array...

3年弱 前 | 3

| 採用済み

回答済み
Function returns different outputs with same inputs
The difference is very simple: Here you return FOUR output arguments from your function call: [e0_, e1_, e2_, e3_] = rotations...

3年弱 前 | 0

| 採用済み

回答済み
matlab 'unique' is skipping rows with data
The basic problem is that your file is large, and by default READTABLE checks a limited number of rows** before deciding what da...

3年弱 前 | 1

回答済み
Passing functions with fixed input
The MATLAB documentation covers this here: https://www.mathworks.com/help/matlab/math/parameterizing-functions.html See also: ...

3年弱 前 | 1

| 採用済み

回答済み
How to fix my attempt to vectorize counts of strings and regexpPatterns in a text file?
SearchTerms = {... 'Term_1', 'Blanket';... 'Term_2', 'blah';... 'Term_3', 'of';... 'Term_4', '(dat|not)\d{1}...

3年弱 前 | 2

| 採用済み

回答済み
Localize the third vector position using regexp
txt = fileread('test.txt') rgx = '(?<=Field(\S+\s+){3})\S+'; out = regexp(txt,rgx,'once','match')

3年弱 前 | 0

| 採用済み

回答済み
Can you change 0^0=1 to 0^0=0 in Matlab?
b = 0; n = 0; v = b^n v(isequal(0,b,n)) = 0 https://en.wikipedia.org/wiki/Zero_to_the_power_of_zero

3年弱 前 | 2

回答済み
how view the content cell array
C = {' fdfd(fg,54)'}; Some steps to remove nesting of cell arrays at the output: The cell array is superfluous so index into i...

3年弱 前 | 0

| 採用済み

回答済み
Quickest way for alternate indexing a vector
u = [5,7,11,13,17,19,23,25,29,31,35,37,41,43,47,49,53,55] v = 5:2:55; v(3:3:end) = []

3年弱 前 | 1

| 採用済み

回答済み
extract word before and after character
C = {'input: pilo(52),iko(54)'; 'input:iko(54)'; 'input:pilo(52),iko(54)'; 'input:pilo(52),iko(54),op(23)'} X = regexp(C,'(\w+)...

3年弱 前 | 1

| 採用済み

回答済み
Accessing all fields within a struct level at once
"Is this possible to achieve without implementing a loop?" Not really, but you can hide the loop using STRUCTFUN: A.one.includ...

3年弱 前 | 0

| 採用済み

回答済み
How can I convert variable size cell structure to column or row data?
C = load('RawCellData.mat').ForbBlocks D = load('DesiredColumn.mat').DesiredRow C(cellfun(@isempty,C)) = {{[]}}; E = vertcat(...

3年弱 前 | 0

| 採用済み

回答済み
Convert datetime to datestr without losing milisecond data
"I tried to set the variable type as 'string' to solve the below problem" The best way to import Excel serial date numbers is a...

3年弱 前 | 1

回答済み
Searching a string on a table to get time
"I still have the same issue about searching into all the Comment columns." The MATLAB documentation explains that you can use ...

3年弱 前 | 0

回答済み
Why are my variables saving only Nan entries?
Cal.data_Txx = ((E) ./ (1 - Cal.data_nu.^2)) .* (Cal.data_epsilon_1 + Cal.data_nu .* Cal.data_epsilon_2); Cal.data_Tyy = ((E) ....

3年弱 前 | 0

回答済み
Split array into groups of close numbers
a = [1,2,3,10,11]; n = 2; x = kmeans(a(:),n) c = accumarray(x,a(:),[],@(a){a})

3年弱 前 | 0

| 採用済み

回答済み
convert a cell (Rx1 cell) to a vector (Rx1 double)
"but it is not clear to me why it transforms 270x1 cell into a vector 257x1 double" It is easy to check your data (you have bee...

3年弱 前 | 1

回答済み
Loading files by replacing some part of the name with a variable
Do NOT name each variable dynamically. Unless you want to force yourself into writing slow, complex, inefficient, insecure, obfu...

3年弱 前 | 0

回答済み
Array of ASCII Characters to String
Forget about loops and doing everything one-at-a-time as if MATLAB was some poor low-level language. Think in terms of arrays a...

3年弱 前 | 0

| 採用済み

さらに読み込む