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

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 2

| 수락됨

답변 있음
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 ...

6년 초과 전 | 1

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

6년 초과 전 | 0

| 수락됨

답변 있음
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('%...

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 1

| 수락됨

답변 있음
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 ...

6년 초과 전 | 1

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

답변 있음
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{:})

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

답변 있음
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))...

6년 초과 전 | 0

답변 있음
"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, ...

6년 초과 전 | 0

답변 있음
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'}; ...

6년 초과 전 | 0

| 수락됨

답변 있음
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

6년 초과 전 | 1

| 수락됨

답변 있음
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 ...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 2

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

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

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 1

| 수락됨

답변 있음
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) ...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

더 보기