Community Profile

Stephen23

Actif depuis 2014

Suspensa Vix Via Fit

All

Content Feed

Afficher par

A répondu
How do I extract a structure array from a single dynamic structure without using for loops?
"Is there a way to do this without a for loop where n is dynamic?" Yes, using MAT2CELL and two comma-separated lists: tmp = ma...

1 jour il y a | 0

A répondu
array in array struct
"i want element (1:10) of each fields.." Your structure only has one field, named "F". You can iterate over the 73 elements ...

1 jour il y a | 1

A répondu
How to convert time in microseconds (queryperformancecounter(qpc)),import from an excel file, to time (hh:mm:ss)?
T = readtable('Project_prova Data Export.xlsx') tx = strcat(T.RecordingDate,'T',T.RecordingStartTime); DT = datetime(tx, "Inpu...

2 jours il y a | 1

| A accepté

A répondu
Extract data from struct array
"Since data(1:10).sys.sys1.sub1.dataPoint1 does not work.." First lets generate your sample structure: dt = 1/1000; T = 5; t...

5 jours il y a | 0

A répondu
How to separate four columns on the basis of 5th column
format short G S = load('Dataset.mat'); D = S.Dataset Method one: ARRAYFUN: V = D(:,5); U = unique(V) C = arrayfun(@(x)D(x...

6 jours il y a | 0

A répondu
Struggling with multiple csv files
"I don't have an idea how to correct these errors. Does anyone have an idea?" The error message already tells you how: "Check t...

7 jours il y a | 0

| A accepté

A répondu
How to create multidimensional array with specified row values
m = 6; n = 7; A = cumsum(ones(m,n),1) A = repmat(1:m,n,1).' A = (1:m).' * ones(1,n) A = min(1:n,(1:m).') A = repmat((1:m)....

7 jours il y a | 1

| A accepté

A répondu
Compile multiple matrices into one without listing them all out
"how can I do the above final line without typing all numbers up to 60?" The general approach is to use a comma-separated list:...

7 jours il y a | 1

A répondu
using if statement to sort data by flags
"I need some code that will go through each pair of rows (e.g. row 1 and 2 then row 3 and 4 etc.) and check if they both have no...

12 jours il y a | 0

A répondu
How do I fix Invalid use of operator in the Code
T = readtable('LP.xlsx') T.DT = datetime(T.Date, 'ConvertFrom','excel') + days(T.Time)

13 jours il y a | 0

| A accepté

A répondu
Most efficient way to put vector on the off-diagonal of the blocks of a block matrix
v = [1,2,3,4,5,6,7,8,9,8,7,6]; u = [9,8,7,6,5,4,3,2,1,2,3,4]; L = sqrt(numel(v)); vM = reshape(v,fix(L),[]); uM = reshape(u,...

14 jours il y a | 1

| A accepté

A répondu
natsortfiles is not working for .png files
This page turns up relatively high on some Google searches, so I might as well make some corrections: "S is a structure. First...

16 jours il y a | 1

A répondu
Deleting elements of an array with consecutively occurring NaN values
A = [NaN,NaN,NaN,NaN,43,NaN,NaN,NaN,45,NaN,NaN,10,22,NaN,NaN,NaN,NaN,36,33,28,21,NaN,20,98,NaN,17,NaN,NaN,NaN,NaN,NaN,2,3,NaN,5,...

19 jours il y a | 2

A répondu
Bringing plots to the "front" to make them more visible?
"s there a way to change the ordering so that it sits on top of the other data series like layers in photoshop?" Of course, use...

22 jours il y a | 0

A répondu
Need guidance: Extracting variable and values from log file
str = fileread('Simulation_Results.txt') tkn = regexp(str,'(\d+):\s*(\d\S+)\s*\n[^\n]+:\s*(\d+)','tokens'); mat = str2double(v...

22 jours il y a | 0

A répondu
Replacing sequences in matrix
A = [4,5,6,7,8,9,10,11,12,13; 104,105,106,107,108,109,110,111,112,113; 204,205,206,207,208,209,210,211,212,213; 304,305,306,307,...

23 jours il y a | 0

| A accepté

A soumis

Number to Words
Convert a numeric to a string with the English name of the number value (GB/IN/US).

25 jours il y a | 16 téléchargements |

A soumis

Words to Number
Convert English number name/s written in a string to numeric value/s (GB/IN/US).

25 jours il y a | 7 téléchargements |

A soumis

Maximally Distinct Color Generator
Generate maximally distinct colors in an RGB colormap.

25 jours il y a | 35 téléchargements |

A répondu
the conversion from data string to serial number
Yes, that is the wrong date.... it is also the wrong data type: why are you using deprecated serial date numbers? The DATENUM d...

25 jours il y a | 0

| A accepté

A répondu
Conversion from d:h:m:s:ms to seconds
"negating the days." I guess you really mean to ignore the days. format long G C = {'104d:11h:59m:38.934815s';'104d:11h:59m:3...

26 jours il y a | 0

| A accepté

A répondu
How to concatenate cells within cells
"Is there a simple way to do this?" Yes, CELLFUN and VERTCAT: X = {{1},{2},{3},{4}}; Y = {{5},{6},{7;8},{9;10}}; Z = cellfun...

26 jours il y a | 1

| A accepté

A répondu
Sort elements in cell array in descending order
fun = @(v) sort(v,'descend'); new_cell_array = cellfun(fun, cell_array, 'UniformOutput', false);

26 jours il y a | 0

| A accepté

A répondu
Question on datestr to datetime conversion
datestr(timeseries(i),formatOut) Most likely TIMESERIES is a serial date number, the use of which is also discouraged and most ...

26 jours il y a | 0

| A accepté

A répondu
Import data from a bad format
TEXTSCAN is very efficient, and imports numeric data as numeric (i.e. no fiddling around with text): fmt = repmat('%f',1,25); ...

26 jours il y a | 2

| A accepté

A répondu
Reading uneven datasets from .mat file
Assuming that: the fields are in the required order (otherwise: you can sort them using ORDERFIELDS). the MAT file contains on...

26 jours il y a | 0

A répondu
Using logical array to extract data without reshape
Note that saving those huge lats&lons matrices is rather waste of space: you actually only need the first row/column. "Is there...

27 jours il y a | 0

| A accepté

A répondu

27 jours il y a | 2

| A accepté

A répondu
Something wrong with "floor" or "fix" functions or it's my code?
"Something wrong with "floor" or "fix" functions" Nope, in fact those functions do absolutely nothing in your code. "or it's m...

27 jours il y a | 1

| A accepté

A répondu
Read CSV into table but not all of the columns
First lets create a fake data file: writetable(array2table(rand(1e5,50),'Variablenames',"V"+(1:50)),"test.csv") Now lets try s...

28 jours il y a | 0