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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 1

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 1

| A accepté

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

plus de 2 ans il y a | 1

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 1

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to replicate a graph from some data collected using webplot digitiser
Strength_Mpa = [ 20 2880 20 3280 20 3990 1200 2000 1200...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to read and plot a txt file
filename = 'Data1.txt'; T = readtable(filename) plot(T.(1),T.(2))

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How can I produce a matrix with below condition?
Something like this may be good enough: k = 8; result = [1; rand(k-1,1)]

plus de 2 ans il y a | 1

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
readtable error : read all columns into a single column
filename = 'data_20091130.txt'; % detect import options, specifying tab as delimiter: opts = detectImportOptions(filename,'D...

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 1

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

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

plus de 2 ans il y a | 0

| A accepté

Charger plus