Answered
Replacing NaN with the average of previous and next cell value
If you are working with a table: %Table. var = {'time';'exp1'}; time = [1;2;3;4;5;6;7;8]; exp1 = [45;67;78;NaN;80;81;8...

6 years ago | 1

Answered
How to Separte table data from html?
You should be using <https://uk.mathworks.com/help/matlab/ref/webread.html webread> rather than <https://uk.mathworks.com/help/m...

6 years ago | 0

| accepted

Answered
picking maximum difference across entries of row vectors
Perhaps a simpler solution which only requires a sort: A = [1 3 6 7 10]; A = sort(A); B = A(end) - A(1); B = ...

6 years ago | 1

| accepted

Answered
Different colors for each item in listbox of an app designer
It is possible to change the color of a uicontrol popup element as explained <https://uk.mathworks.com/matlabcentral/answers/78...

6 years ago | 0

Question


regexprep incorrect multiple replacement
I am trying to replace numbers in a char vector with different numbers using <https://uk.mathworks.com/help/matlab/ref/regexprep...

6 years ago | 1 answer | 1

1

answer

Answered
How to change value in a table so the old one is no longer in the table
You can remove categories from categorical arrays using <https://uk.mathworks.com/help/matlab/ref/removecats.html removecats>. ...

6 years ago | 1

| accepted

Answered
Extract Data from Timetable
This example will help you. A datetime matrix: daytimemat = datetime(['13/04/2018';'25/04/2018';'28/04/2018'],'Format',...

6 years ago | 0

| accepted

Answered
How do I return the indices of randomly sampled matrices?
The following code uses <https://uk.mathworks.com/help/matlab/ref/find.html find> to search for Arand elements in matrix A, and ...

6 years ago | 0

Answered
How can I use xlswrite in a for loop without overwriting?
If you wish to create a new Excel file for every iteration of the loop, you can use: xlswrite(strcat('frequency',num2str(i)...

6 years ago | 1

| accepted

Answered
I am looking for a code to identify if the entered number is odd or even. For example: "ABC 123", I would be really grateful if someone shares the code.
You need to remove the characters before using mod function. You can use <https://uk.mathworks.com/help/matlab/ref/regexp.html ...

6 years ago | 0

| accepted

Answered
How to split the time interval (format-duration) column based on specific intervals
Hi Abdul, The following code reads from a .csv file and splits the column as you requested in two different arrays, Morning a...

6 years ago | 1

| accepted

Answered
How could i search a text for varying patterns
For a pattern of two to three letters, starting with any letter (A to Z) and ending with any letter (A to Z) you can use the fol...

6 years ago | 1

| accepted

Answered
Saving with filename from excel
It does not work because the string contained in _fname_ is wrapped inside a cell. You must convert the cell to the data type...

6 years ago | 1

| accepted

Answered
Combine columns of multiple arrays using for loop
Hi Charlotte, The following code creates a <https://uk.mathworks.com/help/matlab/math/multidimensional-arrays.html multidimen...

6 years ago | 0

Answered
Function file that removes a character in a string?
Two alternatives if you are not allowed to use strrep. function [strOut] = RemoveDash(str) k = strfind(str,'-'); str(...

6 years ago | 1

Answered
Translating curl into Matlab/Webwrite
Hi Frank, Weboptions allows you to add headers to the POST request. %Body of POST request. data = struct('units',100...

6 years ago | 4

Answered
How to arrange a Matrix in different shape?
B = fliplr(A)

6 years ago | 0

| accepted

Answered
How do I read Folders with subfolders ?
There are many ways you can do this. One way is the following: %Find all images in subfolders with .jpg extension. ima...

6 years ago | 1

Answered
Retrieving data from a web page
Hi Enrico, try the following: url = 'http://ricercaweb.unibocconi.it/criospatstatdb/csv/rep06a_'; prompt = 'Enter compa...

6 years ago | 1

| accepted