Réponse apportée
How do I find multiple times in one array the first index of 25 samples exceeding the threshold
You never needed a loop to do what you want. The below will find the start indices of all runs of 1 of length 25 or more: %demo...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
time formate changes while exporting table as excel
The date/time format specifiers in Excel are slightly different from the ones use by matlab. In particular, to display milliseco...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Need help creating a for loop
No need for a loop: result = nonzeros(flipud(tril(repmat((95:-5:5)', 1, 95/5))))' Of course, if this is homework and you do ne...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Making loop calculate-able
Even if your code is correct, it is extremely bad practice to use the same variable names for the loop indices and for local var...

environ 7 ans il y a | 0

Réponse apportée
How to fix the errors Arise from moving .m files and functions in folders?
Ok so I should move all of the programs and functions (.m files ) in other drive except drive C (which Matlab has installed), fo...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Get all sets of cells from two arrays of cells, each of which contains exactly one cell from each column of each arrays.
There's no such thing as an array of cells in matlab. There are matrices or arrays (a matrix being a 2D array) and there are cel...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
matlab file on disk might be empty
I would suggest you contact your IT. There's clearly a synchronisation problem between your computer and the network drive. Note...

environ 7 ans il y a | 0

Réponse apportée
Choosing data based on names
Of course, you don't need to hardcode anything. If you really just want A: [minval, maxval] = bounds(data.Test1(data.Type == '...

environ 7 ans il y a | 1

Réponse apportée
Variance function in matlab
Yes, this is exactly what it says in the documentation. Weight, specified as one of: 0 — normalizes by the number of observati...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How do you remove duplicates of nested cells?
Sounds like: Dates{1} = unique(Dates{1}); %What a misleading variable names if it doesn't contain dates/times! is what you're...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Index position exceeds array bounds(must not exceed 15)
I'm not sure what you find unclear about the error and why you can't find the problem yourself. Index in position 1 exceeds arr...

environ 7 ans il y a | 0

Réponse apportée
large numbers in K means
What's unclear about the error? You must specify less cluster than the number of rows in your matrix/vector. So make sure that K...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
./ and .* operations
As per G A's comment, R2016b introduced automatic expansion for compatible array sizes. So, this works in R2016b or later: x = ...

environ 7 ans il y a | 0

Réponse apportée
Assign value to matrix using vector value as an index
One solution: [row, page] = ndgrid(1:numel(a), 1:numel(B)); %cartesian product of indices of a and B. Indicates which row and ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Loop for extracting a matrix
Reshape your array into a 3D array with rows of 10 elements, columns of 150/10 = 15 elements, and 2 pages. Take the mean across ...

environ 7 ans il y a | 0

Réponse apportée
How to generate the n number of figure for n numbers of subplots
I was very surprised to find that subplot 231 works. It's an undocumented feature of subplot, I would strongly recommend again...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
list names in an array
A lot simpler than all that has been suggested: foldercontent = dir('C:\somewhere\*.csv'); filelist = fullfile({foldercontent....

environ 7 ans il y a | 2

Réponse apportée
Concatenating cell arrays with a different number of columns
maxcols = max(cellfun('size', NonC_tRNAs, 2)); %get the number of columns of the widest array padded = cellfun(@(m) [m, zeros(...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Generate Random Matrix 0's,1's
Note that a 3x2 is a matrix with 3 rows and 2 columns, not the other way round. Bearing in mind that there are n^m such matric...

environ 7 ans il y a | 1

Réponse apportée
Problem with register MATLAB as Automation Server
As the error message says your Windows user account must have administator privilege to install automation servers (matlab or ot...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Extract vector parts around index under boolean conditions
One way: testvector = repmat([0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1], 1, 3); %replicate your demo vector so that there is ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
caesar cyphor encryption problem .
Use mod or rem to constrain values between 0 and a maximum, with wrap-around.e.g: >> mod(0:51, 26) ans = Columns 1 through ...

environ 7 ans il y a | 1

Réponse apportée
Finding every point of intersection between any number of circles and ellipses centered at the origin
Your initialisation variables are a bit strange. You create PhiMax and Phi but never use them. Your b calculation just reduces t...

environ 7 ans il y a | 0

Réponse apportée
Writing data to table with for loops
As commented you don't need loops to construct all your spurs: LO = 11:2:21; RF = 2:0.1:18; n = 0:5; m = 1:5; [mm, nn, rf, ...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
how to identify unique columns, based on the first two rows, make an average of the uniques columns and remove the duplicate columns?
using unique and accumarray: [latlong, ~, group] = unique(yourmatrix(:, [1, 2]), 'rows'); %optionally use the 'stable' option...

environ 7 ans il y a | 2

Réponse apportée
Pull out strings and its values from a text file.
HI Sriram, sorry I was away last week. Parsing the the first part of each message (date, level, source) is trivial. It's the pa...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Most efficient method to search through file names?
I would create a function that parses the filenames and split them into variables of a table (or even a timetable). Then it's tr...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How To Load Multiple Text Files (specific context)
As dpb suggested use one of the modern file import function such as readtable or readmatrix instead of the old textscan. These c...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
my for loop is not extracting all the possible values
A very important rule when you use floating point numbers on a computer (not just matlab, but all languages). Never compare floa...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
Table values that is a scalar string
As said in your previous question, read the doc about tables. For this particular case, the bits about table indexing. () index...

environ 7 ans il y a | 0

| A accepté

Charger plus