Answered
What is the function of a question mark '?' in regular expression
Let's interpret the 1st searchPattern. searchPattern = '/\*.*\*/'; % /\* start with /* % ...

7 years ago | 1

| accepted

Answered
Printing output of fitglm as table to file
Update: MATLAB R2021a or later Use the formattedDisplayText function to capture the model output as a string (see Community Hig...

7 years ago | 1

| accepted

Answered
Plot matrix with columns of same color
One option is put the plot within a loop where you loop through each unique x value. xxUnq = unique(xx); % all unique xx valu...

7 years ago | 1

Answered
Checking the variable for specific string
This solution uses strcmpi() which which compares strings, allowing for case insensitivity so "High" or "LOW" won't cause an err...

7 years ago | 0

Answered
assign header line value to variable
Once you have that string, convert it to a vector like this. s = 'size=256 256 256;'; s(~isstrprop(s,'digit')) = ' '; d = ...

7 years ago | 0

| accepted

Answered
How can I display multiple images in one figure window using for loop?
% Inputs: folder and file extension % Will plot all files with the chosen extension in the chosen folder folder = 'C:\Users\p...

7 years ago | 1

| accepted

Answered
Is there a command that will refocus the active window back to the command window in Matlab's GUI?
commandwindow() % no inputs % Will make the command window the active window. % That is, if you start typing, the text will be...

7 years ago | 0

Answered
movmax - remove duplicated
y= [2,3,4,5,4,3,2]; m = movmax(y,3); m([1,diff(m)]==0) = [];

7 years ago | 0

Answered
How to split a big text file based on specific strings?
The code below will read the txt file attached, psychData.txt (data copied from your question). The first section uses fgetl()...

7 years ago | 1

| accepted

Answered
why wont this simple plot work ?
The 3 lines below create two 10 dimensional arrays. plot(x,y) only allows for scalars, vectors, or matrices. n =10; t = zeros...

7 years ago | 1

| accepted

Answered
Grouped boxplot with different lengths
You can vertically contatenate all of you data into a single column and use a [n x 2] grouping variable 'group' where group(:,1)...

7 years ago | 1

| accepted

Answered
background of editable cells UITABLE
[Continued from comments section under the question] Summary of the problem "when the [callback function] is over, the first l...

7 years ago | 1

| accepted

Answered
unique set from file
c = {'!' 'a:' 'l' 't' '@' [] [] '?' 'a:' 'l' 't' '@' 's' 't' '/' 'a' 'b' 'a' 'n' 'd' 'A~'}; cUnq = unique(c(cellfun(@isc...

7 years ago | 0

| accepted

Answered
Creating subtable from larger table with criteria
This should get you started (see addendum at the end). The approach is to search for a key word that must be within the header (...

7 years ago | 0

Answered
Pulling data from a dialog box and putting the info into an if loop
1) no need to put the 'answer' result in another cell array (userin={answer}) 2) use strcmp() or strcmpi() to compare strings ...

7 years ago | 0

| accepted

Answered
Color indidual labels in plot
As Walter The Great has explained here, this isn't possible to do since the tick labels are not processed through an interpreter...

7 years ago | 1

| accepted

Answered
determine if one shape is fully enclosed inside another shape
Here's a function that returns a logical true/false to determine if the polyshape p1 is fully within p2 by comparing the area of...

7 years ago | 0

Answered
value of checkboxes in uitable
You can add a CellEditCallback function to the UITable that is evoked every time a cell in the UITable is edited. The 2nd input...

7 years ago | 0

| accepted

Answered
remove selected months and years
idx = dv(:,1) == 2019 & ismember(dv(:,2),[6,7,8]); dv2 = dv(~idx,:); % to create a new dv dv(idx,:) = []; % to remove fro...

7 years ago | 0

| accepted

Answered
Added White Frame/Background when using imread()
You can determine the x and y limits of your image by accessing the handle output of image(). Then set your axis limits to the l...

7 years ago | 0

| accepted

Answered
Histogram using Date Stamps
If your data are organized in a table or array, use groupsummary() (requires r2018a). The groupbin should be 'monthname'(see Gui...

7 years ago | 1

Answered
Unable to use the list box items as a UIAxes legend values in App Designer
Use the "DisplayName" property in your call to plot(). Also, move the call to legend() after your're done plotting. But first...

7 years ago | 0

| accepted

Answered
use "uigetfile" in App Designer
Update This has been fixed in R2025a. Focus now returns to the app that called uigetfile after the dialog is closed. The fix i...

7 years ago | 8

| accepted

Answered
How can I export only specific data from a text file to a matrix?
rows = 11:19; % NUMERIC ROWS IN TEXT FILE TO IMPORT nColumns = 8; % NUMBER OF COLUMNS OF TEXT file = 'Testdata.txt'; % THE FUL...

7 years ago | 1

Answered
How to sort a table within groups
sortrows() Examples

7 years ago | 0

| accepted

Answered
How to create daily average of different consecutive years?
Assuming your timestamps are in datetime format, use day() with 'dayofyear' flag to convert the timestamps to day-of-year. The...

7 years ago | 1

| accepted

Question


How to search the change history of a builtin matlab function
In r2019a and other recent releases, the function isvalid() can be used to determine if a graphics object handle is valid. For e...

7 years ago | 0 answers | 2

0

answers

Answered
hypothesis testing in matlab
A common mistake in statistics is to work backwards by first selecting a test, or worse, several tests, and then selecting which...

7 years ago | 4

| accepted

Submitted


msgboxFontSize
Change the fontsize and other text properties in a msgbox(), errordlg(), warndlg() etc.

7 years ago | 463 downloads |

5.0 / 5
Thumbnail

Answered
how to change a cell in a string to a string in a table
Three ways to convert data types within a table or timetable 1. Use convertvars (R2018b) to convert table or timetable variable...

7 years ago | 0

| accepted

Load more