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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

| akzeptiert

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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 2

| akzeptiert

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

etwa 8 Jahre vor | 1

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

etwa 8 Jahre vor | 0

| akzeptiert

Beantwortet
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('%...

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 1

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

Beantwortet
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{:})

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

| akzeptiert

Beantwortet
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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

| akzeptiert

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

etwa 8 Jahre vor | 2

| akzeptiert

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

| akzeptiert

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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 1

| akzeptiert

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

etwa 8 Jahre vor | 0

| akzeptiert

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

etwa 8 Jahre vor | 0

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

etwa 8 Jahre vor | 0

| akzeptiert

Mehr laden