A répondu
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...

24 jours il y a | 0

| A accepté

A répondu
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, ...

24 jours il y a | 0

| A accepté

A répondu
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...

24 jours il y a | 0

| A accepté

A répondu
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) ...

24 jours il y a | 0

| A accepté

A répondu
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(...

25 jours il y a | 0

A répondu
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 ...

25 jours il y a | 0

A répondu
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...

25 jours il y a | 0

A répondu
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{...

25 jours il y a | 0

A répondu
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)

26 jours il y a | 0

| A accepté

A répondu
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...

26 jours il y a | 0

| A accepté

A répondu
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...

27 jours il y a | 1

| A accepté

A répondu
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'...

27 jours il y a | 1

| A accepté

A répondu
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...

28 jours il y a | 0

| A accepté

A répondu
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...

29 jours il y a | 0

A répondu
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,...

29 jours il y a | 0

| A accepté

A répondu
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...

29 jours il y a | 1

| A accepté

A répondu
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...

29 jours il y a | 0

| A accepté

A répondu
How to replicate a graph from some data collected using webplot digitiser
Strength_Mpa = [ 20 2880 20 3280 20 3990 1200 2000 1200...

29 jours il y a | 0

| A accepté

A répondu
How to read and plot a txt file
filename = 'Data1.txt'; T = readtable(filename) plot(T.(1),T.(2))

29 jours il y a | 0

| A accepté

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

29 jours il y a | 1

| A accepté

A répondu
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 ...

29 jours il y a | 0

| A accepté

A répondu
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...

29 jours il y a | 0

A répondu
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...

29 jours il y a | 1

| A accepté

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

30 jours il y a | 0

A répondu
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...

30 jours il y a | 1

A répondu
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...

environ un mois il y a | 0

| A accepté

A répondu
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...

environ un mois il y a | 0

| A accepté

A répondu
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...

environ un mois il y a | 0

| A accepté

A répondu
Go around matrices/vectors columns
Here's one way, which is generalized in that it will work for other polygons besides pentagon, but it assumes the vertices are g...

environ un mois il y a | 1

| A accepté

A répondu
Help extracting data from 3D matrices
Here's one way: A = cat(3,[1 0; 0 0],[0 2; 0 0],[0 0; 3 0]); v = [2;3]; [m,n,l] = size(A); idx = sub2ind([m,n,l],repelem(1...

environ un mois il y a | 0

| A accepté

Charger plus