Answered
Writing array data to file
If |tension| and |epsilon| are non-scalar and are intended to be printed as columns then your code will not work. Text files are...

8 years ago | 1

| accepted

Answered
Plot bar chart from elements of string
>> [U,~,X] = unique(thecountry); >> cnt = histc(X,1:numel(U)); >> bar(cnt) creates this: <</matlabcentral/answers/...

8 years ago | 0

| accepted

Answered
Textscan MULTIPLE DELIM ARRAY and rearrange
This automatically adjusts to the size of the input data. You could easily adapt it to work with either <https://www.mathworks.c...

8 years ago | 1

Answered
How can I call the data from one GUI and display it in another GUI without saving the data in a txt file?
This is simple using <https://www.mathworks.com/help/matlab/ref/guidata.html |guidata|>, or <https://www.mathworks.com/help/matl...

8 years ago | 0

Answered
How to Convert Cell Array to Multiple Variables All At Once?
No loop or |cell2mat| required: B = cat(3,a{:}) each slice/page is trivially accessible using efficient indexing: B...

8 years ago | 0

Answered
can anyone suggest me a command that talks about how matlab performed an arithmetic operation (its steps to give us the final result) ?
I suspect that you might mean this: <https://www.mathworks.com/help/matlab/matlab_prog/operator-precedence.html>

8 years ago | 0

| accepted

Answered
How to print out units between two characters I choose.
Two methods to get the character vectors of those digits: *Method one: <https://www.mathworks.com/help/matlab/ref/regexp.html...

8 years ago | 0

Answered
How to group numbers of a vector
One solution based on |diff| and |regexp|: >> V = [1 2 3 5 7 9 11 13 14 15 16 17 20 22 24 26]; >> X = [0,1,~diff(V,2)]; ...

8 years ago | 2

| accepted

Answered
How do I deactivate matlab from a lost computer
<https://www.mathworks.com/matlabcentral/answers/99859-how-can-i-deactivate-matlab-on-a-machine-i-cannot-access> <https://www...

8 years ago | 0

| accepted

Answered
How to reference value in 14x19x101 array
Try basic subscript indexing: mat = freq_segmented.powspctrm(:,:,1) _without_ the semi-colon (which suppresses output fr...

8 years ago | 0

| accepted

Answered
Sum values corresponding to a number in a vector
>> M = [4,1;4,10;4,2;8,20;5,12;5,4;5,8;5,6] M = 4 1 4 10 4 2 8 20 5 12 5 4 ...

8 years ago | 0

| accepted

Answered
Summing values in one column when a condition has been applied to 2 other columns
The trick is to use |unique| with the |'rows'| option, and get its third (index) output: >> [~,~,idx] = unique(A(:,[1,3]),'...

8 years ago | 0

| accepted

Answered
step by step running of matlab
Use the debugging mode, that is exactly what it is for. <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-...

8 years ago | 0

| accepted

Answered
How to retrieve x, y values from surf given z?
You could use <https://www.mathworks.com/help/matlab/ref/contour.html |contour|> or <https://www.mathworks.com/help/matlab/ref/c...

8 years ago | 3

| accepted

Answered
Find the begining and ending on nan sequence and store
>> A = [7,9;NaN,9;NaN,NaN;4,NaN;6,7;7,9;NaN,9;NaN,NaN;4,NaN;6,7] A = 7 9 NaN 9 NaN NaN ...

8 years ago | 0

| accepted

Answered
Combining y columns of several x,y matrices into one matrix
_"How do I do this please?"_ By following the guidelines in the MATLAB documentation: <https://www.mathworks.com/help/matl...

8 years ago | 1

| accepted

Answered
Remove multiple elements from array based on location
Where |M| is your matrix: M([25832:26450,30050:30750],:) = [] _" is there any way to remove data for a selected time fro...

8 years ago | 2

| accepted

Answered
How to split data text file with unequal elements in the row into several files?
With just one |textscan| call. The test file is attached (you did not provide us with a sample file). opt = {'CollectOutput...

8 years ago | 0

| accepted

Answered
How to set digits of loaded data (again, with specific datas)
Do NOT confuse how data is _displayed_ with the actual data stored in memory! Of course MATLAB loaded all of those digits into i...

8 years ago | 0

| accepted

Answered
How to define a cell array of the full path to each folder file in my computer?
That function is not written very well: # Using |cd| is totally superfluous in that code, because simply using full filenames...

8 years ago | 0

Answered
Calculate true in binary array specifically
This is MATLAB, so you don't need to use loops to solve every little task: >> V = [0,0,0,1,0,1,0,1,1,1,0,1,1,1,0,0,0,1,1,0,...

8 years ago | 0

| accepted

Answered
Why won't \n give me a new line?
Because all characters in the input strings are interpreted literally. With |fprintf| and |sprintf| only the format strings c...

8 years ago | 0

| accepted

Answered
Is it possible to make a dynamically changing matrix in a figure?
An easy way to do this would be to use a |uitable|: <https://www.mathworks.com/help/matlab/ref/uitable.html> Otherwise you...

8 years ago | 0

Answered
Formatting data using an if function
_"how can I adjust the data, so that the purple curve will always be connected?"_ * loop over the length of the data vector. ...

8 years ago | 0

| accepted

Answered
How to read and save different variables in a matfile to another mat file
S = load('file1.mat','var1','var2'); save('file2.mat','-struct','S') OR S = load('file1.mat'); save('file2.mat',...

8 years ago | 0

| accepted

Answered
Display value on a plot
Use <https://www.mathworks.com/help/matlab/ref/text.html |text|>.

8 years ago | 1

| accepted

Answered
How do you get around arrays not having the same dimensions when it comes to multiplication?
>> theta = (0:0.01:1).'; % column vector >> R = [0.01,0.1,1,10,100]; % row vector >> V = (theta.*R)./(R+theta-(theta.^2)...

8 years ago | 0

Answered
several questions for a beginner
The difference is explained here: <https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html> Shor...

8 years ago | 0

| accepted

Answered
Deleting repeating numbers from array
*Method one: <https://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>:* A = [zeros(1,30),1,1,1,1,zeros(1,29),...

8 years ago | 0

| accepted

Answered
Replace portion of array with another array of different size
You cannot replace part of an array with another array that has a different number of elements (unless the replacement is a scal...

8 years ago | 1

| accepted

Load more