Answered
Find and replacing elements in cell array
This solution has the following assumptions. The data has been read into Matlab in the form of a table. [hint: use readtable(...

7 years ago | 0

Answered
Different error bar color than the plot
You can plot the main line and the error bars separately. Here's a demo that plots the main line first and then the errorbars....

7 years ago | 2

Answered
More clear color bar
Use a different color map.

7 years ago | 3

| accepted

Answered
How to create an array and fill it by these values using loop ?
Why use a loop? ds = datestr(datenum(1982, 01, 01) + cumsum([0;ones(479,1)]),'yyyy-mm-dd'); Result: (first 5 rows) ds(1:5,:)...

7 years ago | 3

Answered
Need to normalize time from 'find max' Tidal peaks within a natural cycle
You can use findpeaks() to locate the peak of each cycle. One of the outputs to findpeaks() is the peak's index location which ...

7 years ago | 0

| accepted

Answered
Heatmap plotting incorrect, black lines on X and Y axis outside the figure itself
Problem 1: the black lines Those black lines are merely 100s of tick labels (or, the equivalent of axis ticks in Heatmap) . Yo...

7 years ago | 1

| accepted

Answered
How to eliminate Repeated NaNs in a array?
% Demo data x = [1:5 nan nan nan nan nan nan, 7:10, nan, 12, nan, 13:15, nan nan nan 19 ]; keepIdx = ~isnan(x); ...

7 years ago | 0

| accepted

Answered
Make matrix of N number of (x,y) points
Here's a solution following your definitions. At the top of the code you can defin the input values W1 L1 W2 L2 D and the coo...

7 years ago | 0

Answered
Bootstrap Confidence Interval 90%
"We were asked to calculate the 90% confidence interval [using bootci()]... Is this the correct way?" To determine if it's the ...

7 years ago | 1

| accepted

Answered
Stop graphing when two functions intersect
I'd calculate the index where the curves intersect using intersections() (download it from the file exchange) and I'd do this pr...

7 years ago | 0

Answered
How to order variables in a table
The solution to sorting table columns according to a desired order is below. However, your current method requires that the var...

7 years ago | 2

| accepted

Answered
i Just need Code For non-uniform Sampling,Any help ?
You can draw numbers from a random sample with weighted probability by using y = randsample(population,k,true,w) For example,...

7 years ago | 0

| accepted

Answered
Picking exact data on a plot with ginput
See this answer. It shows two methods of obtaining the coordinates of a data point by clicking on it. The ginput() idea is exp...

7 years ago | 1

Answered
Matching scatter marker size to pixel size
Scatter & markersize method This is a demo for your marker size idea. However, I don't recommend this method (see note below)....

7 years ago | 1

| accepted

Answered
Extracting the same column in a cell array for anova
'c' is your cell array. The first line extracts the first column from each of the elements of c and stores their values in a si...

7 years ago | 0

| accepted

Answered
how do i find the Highest Point and area of each loop for the graph.
General approach: Identify the starting point of each loop. Break apart the continuous data into individual loops. compute ...

7 years ago | 0

| accepted

Answered
How to create a vector that assembles 30000 sets of parameters at random from the specified ranges
You could writing a function that receives the lower and upper bounds as inputs along with the number of values to choose. func...

7 years ago | 0

| accepted

Answered
fitting line for the first part of the graph
You can use ischange() with the linear method to find the point where the slope changes. This requires that the x values are i...

7 years ago | 3

Answered
Building matrix from two vectors
A = 1:100; B = 101:200; C = [A;B].'; % vertical concatenation & transpose

7 years ago | 2

| accepted

Answered
How to Select random data from matrix ?
"i want to take the half of the pixels from this img generated randomly and other half default(white,black doesnt matter ,and...

7 years ago | 2

Answered
pushbutton uicontrol blinkiing (for click me attention seeking)
Here's a functional demo you can apply to your GUI (whether it's built from Guide, uicontrol, or App Designer). Save it to an m...

7 years ago | 0

Answered
delete dimension based on user input
You can use classes overload subsref to implement custom indexing. % Set up default index S.type = '()'; S.subs = {':',':','...

7 years ago | 0

Answered
Determination of the confidence interval for fitted curves
@Torsten Klement, (continuing from comments under the question) There are 2 types of prediction intervals. Confidence interv...

7 years ago | 1

| accepted

Answered
Increment cell number in xlsread
Create the range value using sprintf() where you can specify both the column and row values. Then you can control the row numbe...

7 years ago | 0

Answered
Ploting problems with handle, maybe I have changes in this function.
From the documentation: ________________________________________________ ? Name: Question mark Uses: Metaclass for MATLAB cl...

7 years ago | 0

Answered
How to wrap text within buttons of app-designer
You can make set multi-lined text in a button from within the startup function startupFcn(). The first line below creates two...

7 years ago | 3

| accepted

Answered
Put block behind colorbar
I still think repositioning the axis to make room for a marginal colorbar is the cleanest and most efficient approach (see the v...

7 years ago | 1

| accepted

Answered
How can I plot a filled cylinder with a specific height?
Here's a function where you just feed in the inputs r: radius of cyl. cnt: [x,y] center of cyl height: height of cyl nSides...

7 years ago | 3

Answered
using strrep multiple times
This demo is dedicated to Kazuhisa Hashimoto. usertext = 'up, up, down, down, left, right, left, right, b, a, start.'; s = re...

7 years ago | 2

Answered
How can I change colors and generate errorbars in a bar graph
x = categorical({'A','B'}); y = [3.5, 6.5] ; % Store the bar handle bh = bar(x,y); % Set the bar colors (one color for e...

7 years ago | 0

| accepted

Load more