Answered
finding in which row two array has equal values
% Create fake data for the example B = 1:621; A = randi(621, 500000, 1); % Loop through each element of B, return the row...

7 years ago | 1

| accepted

Answered
Indexing different time ranges from a Timetable.
"First is I want to select all times from 11am to 12pm irrespective of the date. " % Make fake data MeasurementTime = (dateti...

7 years ago | 3

| accepted

Answered
Stop for-loop at the second last column
Here's how to start at the 2nd column and stop at the second to last column for i = 2 : size(a,2)-1 %or for i = 2 : leng...

7 years ago | 0

| accepted

Answered
turning legend off in xline function
Option 1: Use object handles Specity which objects should appear in the legend and produce the legend at the end after all plot...

7 years ago | 2

Answered
I cannot retrieve data from a uitable with app designer
Check out the "ColumnEditable" property:https://www.mathworks.com/help/matlab/ref/matlab.ui.control.tableappd-properties.html I...

7 years ago | 0

| accepted

Answered
Boolean Vector Length Calculation
The vector 'oneCounts' is a list of consecutive 1 counts. It's empty if there are no 1s. tf = [0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0...

7 years ago | 0

| accepted

Answered
strcmp with or-condition
You would use ismember() to find the rows of Tab1.Description that match a list of options. ismember(Tab1.Description, {'Gas'...

7 years ago | 1

Answered
how to delete the previous plot obtained using slider in GUIDE
I understood your description as the following: You'll have a reference line that remains constant on the axes. Then you'll ha...

7 years ago | 0

Answered
subplot with two different x axis
This was a bugger but I finally got it working. It only works when the margins are symmetric. In this example, the left and r...

7 years ago | 0

Answered
Find index of a matrix of values into another matrix
If I understood you correctly, you have a matrix "B" and a column vector "A" and you want the identify the columns of B that are...

7 years ago | 0

Answered
How to delete some signal parts ?
Walter 's suggestion would look something like this (below) but for my fake data, few to no outliers were detected. That might ...

7 years ago | 1

| accepted

Answered
add lines through origin in 3D scatter plot
There is no zline() funciton built into matlab (2019a). Note that xline and yline became available in 2018b. xline and ylin...

7 years ago | 0

Answered
How to cluster a dataset having a vector of clustered indeces?
Your data is a matrix of size [10 x 9]. kmeans() identifies the cluster of each row of the matrix so its output will be a vect...

7 years ago | 0

| accepted

Answered
I can not plot my Matlab code
On each iteration of your while-loop you were overwriting the x variable instead of stored the value for each iteration. Here i...

7 years ago | 0

| accepted

Answered
Skip empty array in plot legend?
Try this. % List all possible legend handles and their strings legHands = {a b c d}; legStrs = {'blue line', level1', 'leve...

7 years ago | 1

Answered
How to add two subtitle of two pictures ?
Demos that add titles and/or subtitles to a plot: How to add a title to each subplot % Method 1: add titles as you create each...

7 years ago | 1

| accepted

Answered
Launch a matlab script when push button app designer Matlab
Open your project in app designer : https://www.mathworks.com/help/matlab/ref/appdesigner.html Add the button: https://www.math...

7 years ago | 0

Answered
shuftting graph plot matlab
mesh(Z) by itself uses the row and column index values of Z as the x and y coordinates. Your matrix is [9x19] so the x values a...

7 years ago | 1

| accepted

Answered
Index in position 2 exceed array bounds
Just before the i-loop, you set y equal to 10. %from your code... y0 = 10; y(1,:) = y0; % same as y = 10 Then on the firs...

7 years ago | 1

Answered
How do I access the axes handles of a confusion matrix?
You're accessing the XTickLabel field correctly but you're trying to enter a 'matlab.ui.container.Menu' object rather than a cel...

7 years ago | 1

Answered
How do I make a histogram that reports the amount of elements per matrix
You're describing a bar chart which differs from a histogram. nRows = [63, 49, 26, 39, 60]; names = categorical({'rest' 'u' '...

7 years ago | 0

| accepted

Answered
Errorbars on scatter plot
Follow this example. If you get stuck, feel free to ask a follow-up question in the comments below. https://www.mathworks.com...

7 years ago | 1

| accepted

Answered
change width and color of a compass plot
Use the handle output from the plotting function. Example: h = polarplot(theta,rho); h.LineWidth = 3; h.Color = 'r';

7 years ago | 0

Answered
Multiple x axis labels and ranges
This is a bit hacky but achieves what you're describing. First I normalize all of your x-coordinates to values between 0:1. ...

7 years ago | 0

| accepted

Answered
Is there a way or function to hide certain lines of code in Matlab 2015a keeping the result normal?
Matlab documentation suggests two methods of protect source code: using a p-file and building a standalone executable. The firs...

7 years ago | 0

Answered
Excel file with three columns and compare the data
"I want to find out which visitors went to the same location and what score they made." There are several ways to interpret thi...

7 years ago | 0

Answered
Assign color to individual stacks in a stacked bargraph.
From what I understood, you want the entire stacked bar to the be the same color: red green or blue. If I misunderstood, I can ...

7 years ago | 0

Answered
Why do I get this message : Error using kmeans ---X must have more rows than the number of clusters.
Possibility 1 Your variable 'A_train' does not have enough rows. You are requesting 8 clusters (k=8) and, as the error indicat...

7 years ago | 0

| accepted

Answered
if string is abc return value
The cell array 'key' lists all possible last-characters and the order determines the value. filename = 'Z2q0002b.jpg'; [~, f...

7 years ago | 0

Answered
Remove data elements of the legend from figure
" I was wondering if there is a way of removing data elements from the figure itself" If you want to remove objects from a figu...

7 years ago | 1

Load more