Réponse apportée
Was struct2array removed from MATLAB?
struct2cell seems to be lowest level still extant, yes. <struct2array#answer_403725> gives some history(*) of its evolution fro...

environ 4 ans il y a | 0

Réponse apportée
How to add header row to cell array?
A cell array doesn't have the facility for headers, per se; if you add to it you've effectively created more data -- and when yo...

environ 4 ans il y a | 1

Réponse apportée
How do I specify the datatype for readcell?
readcell will allow the use of an import options object whch would let you set the variable types. However, I'd strongly encour...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Polyfit on a 3d plot
That's fairly simple, just loop over the displacement array with a set of the position data to compute that set of coefficients ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to have a numerical legend showing with a categorical histogram?
The legend labels are just text; you can make then whatever you want -- try something like: nStroke=[2000,100;2750,125]; ...

environ 4 ans il y a | 0

Réponse apportée
Reading files from different directories
if exist(file, "file") will only find the file if it is in the current working directory or on the search path and only if the ...

environ 4 ans il y a | 0

Réponse apportée
Position of Not-visible figure is WRONG (two monitors bug?)
I deal with it by having a usersettings structure saved as a .mat file that contains all the stuff to restore from the user's la...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
HOW TO GROUP THE ELEMENTS OF AN ARRAY
One of those cases where the optimal way depends upon being familiar with internal array storage order being column-major and ma...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
how can I add and change the position of elements in vector
NB: even if you have (again the unstated problem) >> a=2;b=3; >> ma=[a;b;0]; >> ma=[repmat(ma(3),2,1); sum(ma(1:2))] ma = ...

environ 4 ans il y a | 0

Réponse apportée
Splitting a matrix according to there labels
[ix,idx]=findgroups(X(:,4)); % get grouping variable on fourth column X for i=idx.' % for each g...

environ 4 ans il y a | 1

Réponse apportée
Extract number from string
v=str2double(extractAfter(X,'=')); is one way. For more difficult cases look at the new(ish) @doc:pattern function

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Reading text file and searching for specific lines
D=readlines('Full_TableX.txt'); % read as string array ixP1=find(contains(D,'Pipe')...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Generate hourly timeseries data from "START,END,VALUE" data
Well, in the end it turned out not so bad after all -- and, somewhat surprisingly, it didn't seen to be too bad on performance.....

environ 4 ans il y a | 1

| A accepté

Réponse apportée
if statements inside for loop issue
"I know nuthink!" about Simulink, but the problem you have in the function is primarily that you've created all those named vari...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Add large amount of variables
OK, I'll just make another Answer so previous conversation doesn't distract Brute force; may be something a little more clever ...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Output of a function varies in size for each iteration
Probably as simple a solution as any is to return the indices where the change occurs with both row and column in a form that d...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to use readtable when skipping every second (non-data) line?
>> C=readcell('samplefile.txt'); >> C=C(9:2:end,:); >> C(1:12,:) ans = 12×3 cell array {[16]} {[26]} {'52.7 ...

environ 4 ans il y a | 0

Réponse apportée
Add large amount of variables
Don't try to explain in words; show us precisely what the external software generates. " They are all inside a .mat file..." T...

environ 4 ans il y a | 1

Réponse apportée
StackedPlots: Problem by moving Legend out of plot and expand distance between single charts
The stacked plot is pretty much "what you see is what you get" -- not much is user-variable about the layout -- in particular, f...

environ 4 ans il y a | 0

Réponse apportée
write from cell aray to txt file
fprintf example <<Tabular text file> illustrates a fixed-width text file...if that's the intent use the width parameter on the '...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Appending Values to an Empty Array
Because as written size() returns a two-vector and rate(end+1) is an address for a single array element -- you're trying to stor...

environ 4 ans il y a | 0

Réponse apportée
How can I plot attached three interrelated stacked bars and separately style as well as label their partially recurring block components?
Use something like y = [5 2 0 4 0 0 5 0 3 0 3 0 5 2 0 0 3 ...

environ 4 ans il y a | 1

Réponse apportée
column number extract using find function..
Use the optional second output form of find [r,c]=find(....);

environ 4 ans il y a | 0

Réponse apportée
How to change exponent position in an axis of a surface plot
It's an undocumented property -- hAx=gca; % get axes handle hY=hAx.YRuler; % and the subject axis ruler handle...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Interconnecting different sized matrices
Similar to above but to illustrate vector addressing would be c=[bob anne]; c=c(:,1:[3 end-1 4:6 end]);

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to append values to an array in for loop?
>> for i=1:10:height(direction_table)-10 dx=abs(direction_table.direction(i+1:i+9)-direction_table.direction(i)); ix=find(dx>1...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Assign a categorical value to a table
N=[30,10,10,10]; % the number of the four categories each C=["Running";"Walking"...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to count the amount of times certain row changes in a table?
" Would taking these 3 columns apart help...?" No. tT.Diff=[false;any(diff(tT.X),2)];

environ 4 ans il y a | 0

Réponse apportée
How to couple Matlab to other model for monte carlo simulations??
That all depends on how the other application reads/writes its input/output. If it uses files and you can specify the input/out...

environ 4 ans il y a | 0

Réponse apportée
How to split only one column of a table (based on a space)?
If it's still in text form (string or cellstr), it's no problem dt=split(tTable.DateString); % split the component p...

environ 4 ans il y a | 1

| A accepté

Charger plus