답변 있음
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)],'...

2년 초과 전 | 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;...

2년 초과 전 | 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, ...

2년 초과 전 | 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:...

2년 초과 전 | 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: ...

2년 초과 전 | 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...

2년 초과 전 | 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); ...

2년 초과 전 | 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); ...

2년 초과 전 | 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:...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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...

2년 초과 전 | 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) =...

2년 초과 전 | 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...

2년 초과 전 | 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 ...

2년 초과 전 | 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 = ...

2년 초과 전 | 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)

2년 초과 전 | 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...

2년 초과 전 | 0

답변 있음
how to convert vector in string as example
c=1; a=[4 7] sprintf("cnt %d - [",c) + num2str(a) + "]"

2년 초과 전 | 2

| 수락됨

답변 있음
Logarithm with a variable base
k=2 log(8)/log(k)

2년 초과 전 | 3

| 수락됨

답변 있음
i want to write shorter code
b=[0 1 1 0 0] b|b.'

2년 초과 전 | 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...

2년 초과 전 | 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 ...

2년 초과 전 | 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...

2년 초과 전 | 1

더 보기