Answered
how to filter column from a text file
fmt = '%-6d %.3f %.4f %.4f %.3f\n'; mat = dlmread('test_old.txt'); [fid,msg] = fopen('test_new.txt','wt'); assert...

8 years ago | 0

| accepted

Answered
how to convert data which is saved as cell should be converted into double type how to do it?
An explicit loop is not required to use |fileparts| with a cell array: [P,N] = cellfun(@fileparts,Imagename,'uni',0) But...

8 years ago | 0

Answered
Is the "smooth" function no longer supported in 2018b?
<https://www.mathworks.com/help/curvefit/smooth.html |smooth|> is in the Curve Fitting Toolbox. Do you have the Curve Fitting...

8 years ago | 1

| accepted

Answered
Finding and setting new values for matrix elements within a cell array
The simplest and most efficient solution is to use a |for| loop. But then you write _"...there are also several cases in my d...

8 years ago | 0

Answered
Inserting another column into an existing table
I am guessing that you want that data in columns, something like this: TF = 40:-10:-40; Vmph = 10:10:60; Twc = rou...

8 years ago | 0

Answered
File names in plots legend, from struct data; Matlab says is not an array.
Probably |leg| is not a cell array, so trying to use cell array indexing with it is going to be an error. Solution: make |leg...

8 years ago | 0

| accepted

Answered
Changing letters to other letters with regexprep
You don't need <https://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>, using <https://www.mathworks.com/help/mat...

8 years ago | 1

| accepted

Answered
Keep getting error message for making a script for checking the value of a number between 100&200?
*Explanation*: that bug is very simple: you named a variable |input|, which shadows the inbuilt |input| function. The very fi...

8 years ago | 0

| accepted

Answered
Convert cell array of character vectors to evaluable expressions
This is pretty easy with standard string parsing tools, e.g. <https://www.mathworks.com/help/matlab/ref/sscanf.html |sscanf|>: ...

8 years ago | 0

| accepted

Answered
write in txt file staring from the last line
<https://www.mathworks.com/help/matlab/ref/fopen.html |fopen|> the file using the append option |'a'|.

8 years ago | 1

Answered
How i can insert 'L' number of zeros after each element in a vector
>> x = [1,2,3,4]; >> L = 3; >> y = reshape([x;zeros(L,numel(x))],1,[]) y = 1 0 0 0 2 0 0 0 3 ...

8 years ago | 2

| accepted

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

Load more