回答済み
I keep getting an error "Error using plot Data must be a single input of y-values or one or more pairs of x- and y-values." for the code below calling to a function:
plot([A1(i,1) B1(i,1)],[A2(i,1) B2(i,1)],'r',[B1(i,1) C1(i,1)],[B2(i,1) C2(i,1)],'b',[C1(i,1) D1(i,1)],[C2(i,1) D2(i,1)],'...

3年弱 前 | 1

回答済み
Figure inside a figure in uifigure environment
You'll create two axes inside one figure, not two separate figures. Something along these lines, to get started: f = uifigure;...

3年弱 前 | 0

回答済み
how break loop in execution?
Set the uiprogressdlg 'Cancelable' property to 'on' when it is created. Then in the loop, check the 'CancelRequested' property, ...

3年弱 前 | 1

| 採用済み

回答済み
how refresh chart in the function?
Use cla() to clear the axes: function bubu(app) cla(app.simulaz_UIAxes_Eq,'reset') for i = 1:...

3年弱 前 | 0

| 採用済み

回答済み
delete all the decimal digits that are 0 after the first decimal place
Using %g instead of %.1f does what you want, for this example at least. Also, you can use compose instead of the for loop: ...

3年弱 前 | 0

| 採用済み

回答済み
Identify maxima within parts of vectors
The problem is that vettore_massimi_somma_progressiva is only initialized when h_sum(r)>2 and r==1. So if the first time h_sum(r...

3年弱 前 | 0

| 採用済み

回答済み
Newton Raphson Method: while loop
tol = 1e-6; while true f=log(alpha)-psi(alpha)-log(Samplemean)+meanlnSample; f1=1/alpha-psi(1,alpha); ...

3年弱 前 | 0

| 採用済み

回答済み
Grouped boxplot plots with different lengths and colors in different categories
One way: x1 = randn(10,1); x2 = randn(10,1); x3 = randn(10,1); y1 = randn(100,1); y2 = randn(50,1); y3 = randn(20,1); ...

3年弱 前 | 1

| 採用済み

回答済み
how to manipulate fig file
Here's an example: % create a figure with a couple of plots and save it to a .fig file: f = figure(); subplot(2,1,1) plot(1:...

3年弱 前 | 0

| 採用済み

回答済み
transform the cell 'string' containing strings into a single string
One way: load string.mat S = string; % I rename your variable "string" and clear it clear string % because I'm going to us...

3年弱 前 | 0

| 採用済み

回答済み
If statements vs conditions
In this line, you have the entire array Asim_door (divided by A_fg) on the right side, trying to assign it to a subset on the le...

3年弱 前 | 0

| 採用済み

回答済み
Separate categories in heatmap colorscale
One way would be to put a patch object over the particular cells of the heatmap that you want to be different. Here's a way to d...

3年弱 前 | 1

| 採用済み

回答済み
I have a latitude longitude infos and a certain data. I am tryna do a 2D contour earth map using all of these. But result not right why ?
% some fake data: N = 17025; lat = rand(N,1)*180-90; long = rand(N,1)*360-180; m = rand(N,4); % Calculate the magnitude o...

3年弱 前 | 0

回答済み
Write table with with column names and subject ID
Make data a cell array and you can include row and column headers as desired. See below for how that might work. (I've also rep...

3年弱 前 | 1

| 採用済み

回答済み
Graphic with line erros
% unzip the zip-file unzip('NC_file.zip') close all; clc; format long g; % input = 'C:\Users\vasco\OneDrive\Ambiente de...

3年弱 前 | 1

| 採用済み

回答済み
how create cell array of blank space " "
Cell array: C = repmat({' '},1,5) or: C = cell(1,5); C(:) = {' '} A string array may be useful too: S = repmat(" ",1,5) o...

3年弱 前 | 0

| 採用済み

回答済み
How to correctly use contourf with logarithmic color scale?
The problem is that contourf picks the levels in a linear fashion, so the levels in your contour plot are [0 0.1 0.2 0.3 ... 0.9...

3年弱 前 | 1

| 採用済み

回答済み
plotting multiple plots in multiple figures inside a for loop
nPlots = 24; plotLayout = [2 4]; nPlotsPerFigure = prod(plotLayout); nFigures = ceil(nPlots/nPlotsPerFigure); for ii = 1:n...

3年弱 前 | 0

回答済み
replace character in array cell
Here are a couple of guesses: load matlab_bubu M = vertcat(bubu{:}); idx = M(:,1) > 0; T1 = string(M(:,1)); T1(idx) =...

3年弱 前 | 1

| 採用済み

回答済み
How to extract specific elements from a struct variable?
load trackResults2.mat % idx is a logical vector, with one element for each row of trackRes.traces, % which says whether the...

3年弱 前 | 0

| 採用済み

回答済み
How to break a single horizontal line in the legend of a Matlab plot into two horizontal lines?
legend([pl_1, pl_6, pl_s_1, pl_s_6, pl_s_3, pl_s_7], ... {'disc (impuls)', 'disc (step)', 'stoch1 (impuls)', 'stoch1 ...

3年弱 前 | 0

| 採用済み

回答済み
Two surf plots in the same figure
"seems as if the axes limits are not getting updated as per the set values" Set the axes limits after plotting: figure; ra = ...

3年弱 前 | 0

| 採用済み

回答済み
I have a table in workspace and want to plot the data in it. How do I do that?
If T is the name of your table variable, then: plot(T.Time, T.Voltage)

3年弱 前 | 0

回答済み
Trouble importing data from folder
ls returns a 2d character array in general (on Windows), but regexp expects a character row vector. You can covert the output of...

3年弱 前 | 0

回答済み
how to convert vector in string as example
c=1; a=[4 7] sprintf("cnt %d - [",c) + num2str(a) + "]"

3年弱 前 | 2

| 採用済み

回答済み
Logarithm with a variable base
k=2 log(8)/log(k)

3年弱 前 | 3

| 採用済み

回答済み
i want to write shorter code
b=[0 1 1 0 0] b|b.'

3年弱 前 | 0

| 採用済み

回答済み
create a pie subgraph with assigned percentage values
number = [78 79 80 81 82 83 84 85 86 87 88]; value = [4509 5239 6400 9074 11047 13147 15137 13909 6354 1152 183]; str = 'exa...

3年弱 前 | 0

| 採用済み

回答済み
Horzcat Error in 3x3 matrix with multiplication of Matrices
You've got the scalar zero in there causing the problem. Replace that scalar zero with a vector of zeros the same size as Latty ...

3年弱 前 | 1

| 採用済み

回答済み
How to create an uifigure with gcf
"Currently, if an uifigure exists and you call gcf, a new java-based figure() is created." That's not necessarily true. gcf() c...

3年弱 前 | 1

さらに読み込む