답변 있음
Pass a plot handle into a function argument
You can use 'HandleVisibility','off' to prevent lines from showing up in the legend. figure(1) hold on xx=linspace(-pi,pi,100...

2년 초과 전 | 0

답변 있음
Button activity only works if I set a breakpoint in Matlab App Designer
Put a drawnow after lines of code that make changes to the GUI which should take effect immediately, e.g.: % starting optimizat...

2년 초과 전 | 1

| 수락됨

답변 있음
Call Graphics Array to Make Figures Later In Code
"How can I combine those two for loops so that both figures are made using a single for loop?" % random example data: close al...

2년 초과 전 | 0

| 수락됨

답변 있음
Concatenate multiple tables with different variable names vertically to a big table
You can put all those tables into a cell array, then make all the tables in the cell array have the same set of variable names, ...

2년 초과 전 | 0

| 수락됨

답변 있음
How to save current file loaded in app after using uigetfile?
You can make an app property, say current_filename, and store the name of the currently selected file in that property. Then in...

2년 초과 전 | 0

| 수락됨

답변 있음
how to use plot to draw a minor arc in matlab without calculating the angle range?
c = [-1,2]; % center r = 3; % radius p = [-1,5; -3.121,-0.121]; % two points on the circle: (-1,5) and (-3.121,-0.121) ...

2년 초과 전 | 0

| 수락됨

답변 있음
Piecewise function graph help
L=200; d=10; s=30; r1_max=22.36; r2_max=120.4; r=0:200; F = zeros(size(r)); for i = 1:numel(r) if r(i) < d F(...

2년 초과 전 | 0

답변 있음
Need to create filled circles with a solid border that iterate over each other.
xy = [0 0; 1 1; 2.5 0.5; -2 -1] % crater centers r = [3; 2; 1; 2] % crater radii % use patch to create the circles: figure ...

2년 초과 전 | 0

답변 있음
Modifying a cell array
If any cell array contained in a cell of hhh can only be a row vector, then: hhh = {'a',{'b','c'},{'d','e','f'},{'g'}} idx = c...

2년 초과 전 | 0

답변 있음
cell array for loop assignment
A = {rand(10,2),rand(10,2),rand(10,2),rand(10,2)} nA = numel(A); result = cell(2,nA); for ii = 1:nA result(:,ii) = {A{...

2년 초과 전 | 0

| 수락됨

답변 있음
Finding corresponding value of one vector in another vector
A = [0 1 2 3 4 5 6 7 8 9 10]; B = [0 100 200 300 400 500 600 700 800 900 1000]; result = B(A==7)

2년 초과 전 | 0

| 수락됨

답변 있음
Square wave grating does not display clear white and black bars in output
imresize introduces grey stripes by default (default method is 'bicubic'), but you can change the method imresize uses and see i...

2년 초과 전 | 0

| 수락됨

답변 있음
How can i interpolate values to create image with desired number of pixels
You've got m and n swapped in the definitions of X and Y. [n,m]=size(log_env); X=linspace(1,m,512); Y=linspace(1,n,512); [Xq...

2년 초과 전 | 1

| 수락됨

답변 있음
How can I fill the area under a curve with different colors?
Here's one way: x = 1:100; y = log(x); xb = [1 15 55.5 100]; yb = interp1(x,y,xb); plot(x,y) hold on colors = 'gyr'...

2년 초과 전 | 1

| 수락됨

답변 있음
how do I add the maximum value of arr into arrSorted within the while loop?
while arr > 0 This iterates while all elements of the array arr are greater than zero. If arr contains elements that are less t...

2년 초과 전 | 0

| 수락됨

답변 있음
How to choose color in bar graph
The colors appear to change on each run because you're plotting into the same axes (with hold on) each time. It's the same as p...

2년 초과 전 | 0

답변 있음
How can I get a loop within a loop to return a value as a matrix?
B = -0.388; C = -0.026; P = 1.2; T = 305:5:550; R = 8.314; V9 = mvolume9(B,C,P,T,R); disp(V9) function V9 = mvolume9(B,C,...

2년 초과 전 | 0

| 수락됨

답변 있음
How do I pass data between functions in MATLAB App Designer?
load(filename) creates variables in a workspace (i.e., a function's workspace or the base workspace - in this case the workspace...

2년 초과 전 | 1

| 수락됨

답변 있음
Merge multiple matrices with different columns into a single matrix
load cell_test One way: % get the size of each matrix in cell_test(:,1) sz = cellfun(@size,cell_test(:,1),'UniformOutput',fal...

2년 초과 전 | 0

| 수락됨

답변 있음
How to replicate a graph from some data collected using webplot digitiser
Strength_Mpa = [ 20 2880 20 3280 20 3990 1200 2000 1200...

2년 초과 전 | 0

| 수락됨

답변 있음
How to read and plot a txt file
filename = 'Data1.txt'; T = readtable(filename) plot(T.(1),T.(2))

2년 초과 전 | 0

| 수락됨

답변 있음
How can I produce a matrix with below condition?
Something like this may be good enough: k = 8; result = [1; rand(k-1,1)]

2년 초과 전 | 1

| 수락됨

답변 있음
contour lines obscured on a surface.
If you only need to see the plot from above (2d, xy view), then you can set Z to zero in the surf call but still use your Z for ...

2년 초과 전 | 0

| 수락됨

답변 있음
secondary x-label not displayed in the figure
I think you need to set the axes' position: % made-up data: lszs = 3; norm_Phi_bR = [1 2]; Entr_eff = [0 0; 1 2]/10; norm_P...

2년 초과 전 | 0

답변 있음
Single legend entry for a line with endpoints.
x=0:90; y=30*cosd(x-30).^6-20; plot(x,y,'-b') hold on x_red = x(26:36); y_red = y(26:36); plot(x_red,y_red,'-ro','MarkerFa...

2년 초과 전 | 1

| 수락됨

답변 있음
readtable error : read all columns into a single column
filename = 'data_20091130.txt'; % detect import options, specifying tab as delimiter: opts = detectImportOptions(filename,'D...

2년 초과 전 | 0

답변 있음
How to Convert data from HEX codes to Numeric
format long g T = readtable('hex codes example.xlsx') T.DecCodes = hex2dec(strrep(T.HexCodes,' ','')) writetable(T,'hex and d...

2년 초과 전 | 1

답변 있음
Shading a delimited area in a contour plot
Maybe something like this. Adapt as needed. E = 23; F = 0:0.01:0.3; K = round(6:0.2:20, 2); [X, Y] = meshgrid(F, K); Re...

2년 초과 전 | 0

| 수락됨

답변 있음
Table formatting problem with cell and array matrix
% inputs pnamesNew ={'*H2';'H2O';'*O2';'H2O(S)';'*OH';'*H';'*O';'HO2';'H2O2';'O3'}; maxFracsNew = [9.6220e-01;8.9880e-01;1.097...

2년 초과 전 | 0

| 수락됨

답변 있음
Reading data from a .data file
readtable with 'FileType' and 'NumHeaderLines' parameters specified may work: % I zipped the example .data file I made, in orde...

2년 초과 전 | 0

| 수락됨

더 보기