Answered
errorbar with mean and standard deviation
% First, I create a random matrix x, and calculate % the mean (x_mu) and standard deviation (x_std) of % each column % *You...

4 years ago | 0

| accepted

Answered
How to combine two matrix and extract value from one matrix to another matrix in same position?
a = [6 6 5 6 5 6 6]; b = [0.74 0.66 0.58 0.47 0.62 0.75 0.76]; group_1 = 5; group_2 = 6; b(a == group_1) b(a == g...

4 years ago | 0

Answered
Argument to dynamic structure reference must evaluate to a valid field name.
You can avoid this error by changing this line (line 164): s(2).subs = {requestedStats{p}}; to this: s(2).subs = requestedSta...

4 years ago | 0

Answered
Finding the surface area of a balloon
surfaceBalloon(1,[1:3]) % check consistency with the prompt M = linspace(0,6,100); % calculate and generate plot plot(M,surfac...

4 years ago | 1

Answered
Matlab image spatial resolution, change pixel
You can try imresize() im = imread('image_1.png'); for ii = 1:6 subplot(2,3,ii); imshow(imresize(im,2^-(ii-1))); en...

4 years ago | 1

Answered
Plot legend and axis label does not display
Avoid putting extra spaces in character vectors, e.g., use: 'Vert' , 'middle' , 'Interpreter' , 'latex' instead of: 'Vert' , ...

4 years ago | 0

Answered
How do I get rid of custom data tip?
If feasible, you can store the handle to the DataTip when it is created (Option 1 below). If not, you can find it using findobj...

4 years ago | 1

Answered
Add Row and Column to every nth row and column in Matrix?
I'll start with the second case first: format compact A = [1,2,3,4;1,2,3,4;1,2,3,4;1,2,3,4]; new_A = zeros(6); new_A([2 3 5 ...

4 years ago | 0

Answered
How can I plot phase diagrams in MATLAB?
Here's how you might produce something similar to 2.jpg: p = [0.13 0.26 0.42 0.52]; % adjust these points along the curve to yo...

4 years ago | 0

| accepted

Answered
How to measure the euclidean distance of points continuously from point A to B (and point B to C)?
load('cell_of_double_baskets.mat') cell_of_double_baskets{1} n = numel(cell_of_double_baskets); d = cell(1,n); for kk = 1:n ...

4 years ago | 0

| accepted

Answered
Not able to make dummy variables
C = readcell('data.csv') dummy_gender = strcmp(C(2:end,4),'''M''')

4 years ago | 0

Answered
How is the best choice to import many tables in matlab?
% input_path = 'D:\OneDrive\MSc_Thesis\Projects\NEOs_orbits\OutputFiles\'; input_path = '.'; files_ast_orbits = dir(fullfile(i...

4 years ago | 1

| accepted

Answered
Plotting a 3d curve between a given equation and x and y axis
%x varies from -4 to 4 x = -4:0.1:4; %y varies from -4 to 4 y = -4:0.1:4; %g is constant g = 1; % Hx = (1/pi)*(arctan(((g/...

4 years ago | 0

Answered
How to combine two plots, each with multiple plots
figure() p1 = uipanel('Title','Sales Growth','Position',[0 0.5 1 0.5]); t1 = tiledlayout(p1,3,3); for i = 1:9 nexttile(t...

4 years ago | 0

| accepted

Solved


Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...

4 years ago

Answered
Error using readtable (line 318) Error when I Try to Read in a .dat File
Try using the second output from uigetfile() as well, in order to refer to the full path of the file selected: [filename,pathna...

4 years ago | 0

| accepted

Solved


Number Puzzle - 040

4 years ago

Solved


Number Puzzle - 034

4 years ago

Solved


Number Puzzle - 033

4 years ago

Solved


Number Puzzle - 032

4 years ago

Answered
How can I modify this contour plot and add arrows?
Is this what you want to do? x=0:0.01:1.5; y=0:0.01:1.5; T1=100;T0=0; [X,Y]=meshgrid(x,y); Z=(T1-T0)*2.*X.*Y+T0; [cs1,h1]=...

4 years ago | 0

| accepted

Answered
How can I extract specific data from Structure Array?
load B0005.mat temp = [B0005.cycle(strcmp({B0005.cycle.type},'discharge')).data]; Capacity = [temp.Capacity];

4 years ago | 0

| accepted

Answered
Find files of a certain extension and populate a structure field with those file names.
dir() with no output argument (i.e., not assigning the result to any variable) displays the result to the command line. S = dir...

4 years ago | 0

Answered
rename files using data in cell array
You can rename files using copyfile() or movefile(). In either case the destination argument would be the new name of the file ...

4 years ago | 0

Answered
For loop in a function (not getting right results)
Several things. First: for i = length(T_K) should be for i = 1:length(T_K) The first way just iterates once, using the last ...

4 years ago | 0

| accepted

Answered
Testing for a string in a cell array in a structure
Enclose cell array arguments in the call to struct() with {} to make them scalar cell arrays, because struct() will create an ar...

4 years ago | 1

| accepted

Answered
I want to be able to choose a letter/number from a string.
% in case you have a String rather than a character vector, convert it % first: % str = "CaCO3"; % str = char(str); str = ...

4 years ago | 0

| accepted

Answered
Convert values in text file into matrix
This file contains 5120 numbers on a single line, so the matrix is of size 1-by-5120: A = readmatrix('textT.txt','Delimiter',' ...

4 years ago | 0

| accepted

Answered
How to convert csv file to .dat file?
% read the csv file: data = readmatrix('data.csv') % write the data to .dat file using % space as the delimiter (no commas): ...

4 years ago | 1

| accepted

Load more