Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

Respondida
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...

casi 7 años hace | 1

| aceptada

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

Respondida
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 == '...

casi 7 años hace | 1

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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...

casi 7 años hace | 0

Respondida
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...

casi 7 años hace | 0

| aceptada

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

casi 7 años hace | 0

Respondida
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 ...

casi 7 años hace | 0

| aceptada

Respondida
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 ...

casi 7 años hace | 0

Respondida
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...

casi 7 años hace | 1

| aceptada

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

casi 7 años hace | 2

Respondida
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(...

casi 7 años hace | 1

| aceptada

Respondida
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...

casi 7 años hace | 1

Respondida
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...

casi 7 años hace | 0

| aceptada

Respondida
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 ...

casi 7 años hace | 0

| aceptada

Respondida
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 ...

casi 7 años hace | 1

Respondida
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...

casi 7 años hace | 0

Respondida
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, ...

casi 7 años hace | 2

| aceptada

Respondida
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...

casi 7 años hace | 2

Respondida
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...

casi 7 años hace | 1

| aceptada

Respondida
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...

casi 7 años hace | 1

| aceptada

Respondida
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...

casi 7 años hace | 1

| aceptada

Respondida
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...

alrededor de 7 años hace | 2

| aceptada

Respondida
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...

alrededor de 7 años hace | 0

| aceptada

Cargar más