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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

Respondida
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'); ...

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 2

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 2

| aceptada

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

Respondida
R2019a blank property inspector macOS Catalina
This is a known issue with no workaround currently. See this answer by Mathworks.

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

Cargar más