Réponse apportée
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)],'...

presque 3 ans il y a | 1

Réponse apportée
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;...

presque 3 ans il y a | 0

Réponse apportée
how break loop in execution?
Set the uiprogressdlg 'Cancelable' property to 'on' when it is created. Then in the loop, check the 'CancelRequested' property, ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
how refresh chart in the function?
Use cla() to clear the axes: function bubu(app) cla(app.simulaz_UIAxes_Eq,'reset') for i = 1:...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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: ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Newton Raphson Method: while loop
tol = 1e-6; while true f=log(alpha)-psi(alpha)-log(Samplemean)+meanlnSample; f1=1/alpha-psi(1,alpha); ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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); ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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:...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
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) =...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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 ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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)

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
how to convert vector in string as example
c=1; a=[4 7] sprintf("cnt %d - [",c) + num2str(a) + "]"

presque 3 ans il y a | 2

| A accepté

Réponse apportée
Logarithm with a variable base
k=2 log(8)/log(k)

presque 3 ans il y a | 3

| A accepté

Réponse apportée
i want to write shorter code
b=[0 1 1 0 0] b|b.'

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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 ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 1

Charger plus