Réponse apportée
grouping array based on similar row element
The easiest: savelocation = 'C:\somewhere\somefolder'; fileformat = 'submatrices_%02d.txt'; group = findgroups(A(:, 1)); s...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
fwrite fread consistency issue
It's all to do with encoding. Note that the behaviour you see is going to be OS dependent and locale dependent in some ways.In a...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
import dll into matlab
In R2016b as per the original question, the only way to use the library would have via its python binding. See the doc for guida...

plus de 6 ans il y a | 0

Réponse apportée
Is this a valid expression?
As matlab tells you is not valid, you can't have (:) on the output of a function. Since (:) is simple a reshape, tmpOffsets = ...

plus de 6 ans il y a | 0

Réponse apportée
Find the index of zero in cell and put it as empty
A(cellfun(@(x) isequal(x, 0), A)) = {[]}; %replace any cell whose content is the scalar 0 by empty is one way. edit: fixed co...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements.
Your criteria for the cluster connectivity is a bit strange in my opinion since it doesn't actually require adjacency. If that's...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
readtable() Giving NaN for some data files (.txt)
Certainly, it's not clear what is confusing readtable with your second file. Whatever it is it has to do with the space characte...

plus de 6 ans il y a | 0

Réponse apportée
Finding columns that contains a specified string
The format of your excel file is really not ideal. Anyway, this is one way: header = readcell('Rahmani.xlsx', 'Range', '1:4'); ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
how to add rows at missing times in a table?
The easiest would be to convert your table into a timetable. You could indeed use the unix time after converting it into datetim...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Making cell array of cells of strings the same size by adding empty strings
maxlen = max(cellfun(@numel, yourcellarray)); newcellarray = cellfun(@(s) [s, repmat({''}, 1, maxlen - numel(s))], yourcellarra...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Trying to Set Data in UITable, but getting error: Values within a cell array must be numeric, logical, or char
The error message is indeed correct. All the elements of rows 2:end of column 1, 6 and 11 of your cell array are themselves 1x1 ...

plus de 6 ans il y a | 0

Réponse apportée
How to convert cell columns in a table?
Probably, data = readtable('LA-01.csv', 'Delimiter', ' ', 'MultipleDelimsAsOne', 1, 'TreatAsEmpty', 'N/A') would fix the probl...

plus de 6 ans il y a | 0

Réponse apportée
Converting and Instrument Object Array (instrfind) into strings?
I don't have any serial port on this machine so can't really test for the actual property names, but it should be something like...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Nonlinear regression fits on data sets in a cell array?
For the problem with the tables: Before the loop: fittables = cell(1, numel(theFiles)); %preallocate cell array to store all ...

plus de 6 ans il y a | 0

Réponse apportée
Automatic legend changing based on the function
First, minor things: I would recommend you put a space (preceded by a colon maybe) at the end of your input strings so that wha...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Replace NaN with next good value in a certain column of a table
It's as simple as: T2 = fillmissing(T2, 'next', 'DataVariables', {'lat', 'lon', 'station_elevation'}) or T2 = fillmissing(T2...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How can I iterate all three cases at once in one script?
"rather than having to change to and every single time and in multiple lines." The problem is that you've hamstrung yoursel...

plus de 6 ans il y a | 1

Réponse apportée
Keeping Order of sql query in Matlab? How can I speed up my Code?
I don't have the database toolbox, but according to the online documentation fetch returns a table by default. If it's not the c...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Comparing array with any element of the array
Ok, now I understand what you want to do. Note that datasets have been deprecated for a while and it's recommended you use tabl...

plus de 6 ans il y a | 0

Réponse apportée
Generating combination of binary numbers
nchoosek outputs the indices in your desired ordering, so it's easy: N = 5, M = 2; %demo data cols = nchoosek(1:N, M); A =...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How can I get the root node of a given node from a directed graph ?
the first element of the vector returned by toposort would be your root node. Of course, your graph must be acyclic and if your ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
I don't know why hold on wont work- it only produces one graph with one model and not both on one graph
Your code creates a figure and sets the axis to retain plots in this figure with hold on. Your code then creates a second figur...

plus de 6 ans il y a | 0

Réponse apportée
Index in position 2 is invalid. Array indices must be positive integers or logical values.
The error message is clear, the index in position two is invalid because it contains either non-integer values or values less th...

plus de 6 ans il y a | 0

Réponse apportée
Illustrate weighted matrix to represents areas
You can do something like: weights = [0 0 0 0 0 0; ...corrected spelling of the variable 0 0 0 1 0 0; 0 1 1 1...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
kill an external process (simulation ) if it is taking too long
You could use a timer for this, it would be something like: killtimer = timer('ExecutionMode', 'singleshot', 'StartDelay', 5, '...

plus de 6 ans il y a | 0

Réponse apportée
Label segments based on percentage
Much simpler code: threshold = 0.3; %30% threshold M = cellfun(@(m) mean(m, 1) >= threshold, AL_128, 'UniformOutput', false) ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
R2019a blank property inspector macOS Catalina
This is a known issue with no workaround currently. See this answer by Mathworks.

plus de 6 ans il y a | 0

Réponse apportée
Is there a function alternative to get array/matrix/cell elements?
Indeed it would be very nice to be able to chain indexing to function calls. I believe it's an often requested enhancement but i...

plus de 6 ans il y a | 1

Réponse apportée
Create cell array of numbers
This is dead easy if you are happy using the newish string type instead of char vectors: s = string(1:10) You can convert that...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
creating multiple copies of an array
"indexing will be hard because I will need to copy it for more [...} I will need to copy it for 5000" Please read Stephen's li...

plus de 6 ans il y a | 0

Charger plus