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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 2

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 2

| akzeptiert

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 1

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 1

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 0

Mehr laden