Risposto
dlmread reads rows instead of columns
*EDITED* something like the following, dlmread(filename,' ',[0 0 4 0]) or use textscan, filename = 'dummy.txt'; ...

circa 8 anni fa | 0

Risposto
table gui, set parameters
Fairly simple, data1=[1 16;1 15;1 14]; t=uitable; t.Data = data1; t.ColumnName = {'A','B'}; %and so on read th...

circa 8 anni fa | 0

| accettato

Risposto
how to export numerical part without decimal and digit with fractional part in the same array
One approach is to use fprintf and then specify the output format, A = [1.000 1.000 6338110.000 0.198 0.064 1.701 1.505...

circa 8 anni fa | 1

| accettato

Risposto
How to call and also return a matrix in a function?
_Output argument "output" (and maybe others) not assigned during call to "variable"_ Just as it says you probably haven't ass...

circa 8 anni fa | 2

| accettato

Risposto
hai i need a command for following details........
Simpler: Use randsample <https://www.mathworks.com/help/stats/randsample.html> randsample(2:12,4) ans = 9 ...

circa 8 anni fa | 1

Risposto
Find which cell element that contains element.
Use ismember first and then find indx = find(cellfun(@(x) ismember(B,x),A))

circa 8 anni fa | 0

| accettato

Risposto
How can I increase the precision of a limit to give a number with more digits?
if you want to display it on the command line, use format long if you want to write to a file, use fprintf fprintf('%...

circa 8 anni fa | 1

| accettato

Risposto
Index of non empty cells in a cell array
~cellfun(@isempty,C) or ~cellfun('isempty',C) The latter is faster (when run for 100000 iteration), so prefer that...

circa 8 anni fa | 0

Risposto
Subplot of bar graph within for loop
The command figure; creates a new figure everytime. You should move it outside both loops. And also the position of the s...

circa 8 anni fa | 1

| accettato

Risposto
How to find maximum without using max
You would need to use two for loops. One to move across rows, the other to move across the elements in each row (columns). What ...

circa 8 anni fa | 1

Risposto
how to convert a .textdata file in .mfile and use it
_how to convert a .textdata file in .mfile and use it_ There's a big difference between a *m-file* and a *mat-file*. - m-f...

circa 8 anni fa | 0

Risposto
Error using plot. Vectors must be the same length
Shouldn't you be using only the hours and minutes relevant to those respective months? decimal_hour = hh(indexjan)+(mm(index...

circa 8 anni fa | 0

Risposto
How to list variables in save() as an array of strings
use a cell array, vars = {'a','b','c'}; and then, save('dummy.mat',vars{:})

circa 8 anni fa | 1

| accettato

Risposto
Having trouble inserting data into my GUI table.
It's simply, f = figure; t = uitable(f); t.Data = randi(10,5); and if you're using appdesigner, app.UITable.Da...

circa 8 anni fa | 0

Risposto
Plz help me with this function related question
when you call |findandReplace| function in your main script, you should pass the inputs you received from the user. You have sto...

circa 8 anni fa | 0

Risposto
Reshape array of cells with different column sizes into matrix
One approach is to make all elements equal in size by padding 0s or nans and then use cell2mat, m = max(cellfun(@numel,T1))...

circa 8 anni fa | 0

Risposto
"Assignment has more non-singleton rhs dimensions than non-singleton subscripts" how to solve this error?
What exactly are you trying to do? X has 64 rows and 1 column decoded_bits has 1 row and 64 column and when you say, ...

circa 8 anni fa | 0

Risposto
Sorting a matrix by one column
That's not a matrix. If you meant to store them in cell arrays, C = {'john', 'jojo';'victor', 'vivi';'andre', 'dredre'}; ...

circa 8 anni fa | 0

| accettato

Risposto
Why it comes up with only the first slice all the time?
Probably you intended to write, sprintf('Z0%d',i); instead of sprintf('Z01',i); %the outout here is always Z01

circa 8 anni fa | 1

| accettato

Risposto
How to check if variable is in workspace?
You're probably using this code inside a function but not the main script that uses your base workspace. *That explains why you ...

circa 8 anni fa | 0

Risposto
Using ifelse in a loop - possible?
You need to use indexing. <https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html> here is...

circa 8 anni fa | 0

| accettato

Risposto
Hi, I want want to read excel files that are located in subfolders in my directory.
Importing data from many files has been explained exhaustively. Please read these: <https://www.mathworks.com/matlabcentral/a...

circa 8 anni fa | 2

| accettato

Risposto
Auto generating x and y axis of same scale and labeling
Define it once with an axis handle and then use linkprop to link all your xlim, ylim properties, read this: <https://www.math...

circa 8 anni fa | 0

Risposto
How can I average a matrix of 105108X6 constructed every 5 minutes measured data to 15 min?
I's suggest using a timetable. <https://www.mathworks.com/help/matlab/timetables.html> Frist convert your matrix to timeta...

circa 8 anni fa | 0

| accettato

Risposto
Index character in table
another way is to use regexprep, A_new = regexprep(A,'[A-Z]','') A_new = 1×2 cell array '024' '005'

circa 8 anni fa | 1

| accettato

Risposto
How to find mean from different variables in work space
why do you have 91 variables named sequentially in the workspace? Why not use a 3D matrix?! Read this: <https://www.mathworks...

circa 8 anni fa | 1

| accettato

Risposto
How to save multiple outputs of a for loop and combining it into a matrix?
It's always better to pre-allocate, A = zeros(25,10); %number of rows, number of columns Then use indexing, <https://d...

circa 8 anni fa | 1

| accettato

Risposto
Resizing of cells in a cell array
Use a loop, for k=1:numel(C) if numel(C(k))<3 C(k) = [C(k) zeros(1,3-numel(C(k))); else C(k) = C(1:3) ...

circa 8 anni fa | 0

| accettato

Risposto
Reading in the values from excel
replace x = mean(data_in(:,3)); with x = mean(data_in(1:10,3)); |1:10| could be any number indices within its lim...

circa 8 anni fa | 0

Risposto
Find and trim text in a table
use regexprep, T = table({"A_1";"AB_2";"B_10"},[1;2;1],[6;7;5],... 'VariableNames',{'Section' 'Data1' 'Data2'}); T.Se...

circa 8 anni fa | 0

| accettato

Carica altro