Answered
bar chart 2 data sets side by side with different axis
You can do that by using abs(S1_free) and specifying the locations and widths of the bars: T3_blocked = [2 1.95 1.5 0.1 1.4]*1e...

4 years ago | 0

| accepted

Answered
boxplot change X-Axis
You can use the 'Positions' argument to boxplot(), see below. (I also changed your variable "median" to be "my_median" so it doe...

4 years ago | 1

| accepted

Answered
After separating the data sizes in some order into two groups, and subtract their corresponding values. Then I want to store them in the original order.
The best thing to do is to is not to separate the data into two groups at all but instead perform the subtraction on the data in...

4 years ago | 0

Answered
loop in function inside
You must call the function f() somwhere. Your code defined f() but never used it; that's why there was an empty plot: y was not ...

4 years ago | 0

| accepted

Answered
実数配列と複素数配列を結合してcsv保存する方法
[EDIT: My answer is overkill since you can just use writecell(), as some other answers say, but I'll leave it up anyway because ...

4 years ago | 2

Answered
Interpolation of function of 3 variables
It looks like the data in that file is insufficient for making a gridded interpolant (because there is no information about Seam...

4 years ago | 0

| accepted

Answered
reiterating 1s and 0s in a single column
Use repmat(): A = [0;1;1;1;1;0;1;1]; x = 4; B = repmat(A,x,1); disp(B);

4 years ago | 0

| accepted

Answered
cell and strings in an array
try data = cell(4:24); catch ME disp(ME.message); end If you want each cell of data to contain {'AD';'ED';'FA';'DE'...

4 years ago | 0

| accepted

Answered
Rescaling time vector in 2d
If I understand correctly, here's how you can rescale a matrix to be from -1.4 to 2.4 instead of from 1 to 200: A = reshape(1:2...

4 years ago | 0

| accepted

Answered
How can i use a vector variable inside a function normally
Looks like your hunch was correct: there was a missing period in that expression. % This is a driver program which calls differ...

4 years ago | 0

Answered
Creating histogram without using built in function
You're going to run into edge effects like that, due to the nature of floating-point arithmetic. You can just fix values out of ...

4 years ago | 1

| accepted

Answered
Help with operations between elements from a matrix
data = [ ... 26 1; ... 35 2; ... 27 3; ... 25 4; ... 41 5; ... 28 5; ... 34 5; ... 34 6;...

4 years ago | 1

| accepted

Answered
How can I use the Bisection method to converge on an arbitrary value?
In fact your loop runs 0 times (because v(xr) is not equal to 100). % Define function R = 4; v = @(x) pi.*x.^2.*((3.*R-x)./3)...

4 years ago | 0

| accepted

Answered
How to enter the path of the folder that has the raw data to be analyzed
The problem is that dir() returns an empty struct array because the directory you gave it doesn't exist. You can fix this by gi...

4 years ago | 0

Answered
How to plot x^3-4x^2+1 without setting the domain?
"4x" is not a valid expression. "4*x" is. fplot(@(x) x.^3+4*x.^2+1)

4 years ago | 0

| accepted

Answered
Delete Vector Element but Keep Vector Length
Note that using NaN's in a vector you're plotting is useful to show that something is missing: X = [0,1,2,3,4,5,6,7,8,9,10]; Y...

4 years ago | 0

Answered
How can I read this text file in MATLAB?
If your version of MATLAB is R2019a or newer you can use readmatrix(): A = readmatrix('N3-1.txt') % make sure we got it all: ...

4 years ago | 0

Answered
Save array values separetly in cells during a for loop
You cannot convert a numeric matrix to a cell array in-place like that, but you can make a new cell array variable and do it: q...

4 years ago | 0

| accepted

Answered
How to plot two matrices overlapping in the same figure with transparent color?
Here are two methods to do it (the second one is probably easier). Step 0, load data and prepare the variables: %Load/read dat...

4 years ago | 0

| accepted

Answered
Is it possible to use the "contains" function on a table in Excel? I keep getting the following: "Error using contains. First argument must be text."
I didn't have the function importdata() you're using to read the file, so I made a guess at what it does and adjusted the syntax...

4 years ago | 0

| accepted

Answered
Plotting a Graph From a Cell Array
First, check out the data: load('A.mat') whos Kappa_x_num{1,1} Then, do some counting: [m,n] = size(Kappa_x_num); max_valu...

4 years ago | 1

| accepted

Answered
How do I find the index of the first occurance of a string in a cell array?
person_1 = { ... 1 99 0.04 pi/4 1e6; % run times "Ball Glitch" "Some other event" "Basket Glitch" "Basket Glitch" "Bal...

4 years ago | 0

| accepted

Answered
Read a 3D matrix from Excel file
I think a 2D matrix is the way to go, since you have one value for each (x,y) point. Here are some ways you might visualize you...

4 years ago | 0

| accepted

Answered
Delete rows from a cell array based on key words
data = { ... '6440.016' 'hold'; ... '7378.016' 'max-pressure-evac 60.0'; ... '8372.016' 'max-pressure-evac 60.0';...

4 years ago | 0

| accepted

Answered
Apply colormap of one surface to another
You can specify the color of a surface separately from the z-values, using the fourth input argument C. First, the default: col...

4 years ago | 0

Answered
The sum of elements by multiplying two different vectors
a = 1:10; t = 0:0.001:1; b = zeros(size(t)); % it is known that b is to be the same size as t for n = 1:numel(a) b = b +...

4 years ago | 0

Answered
Replace a matrix on a text file
You can do this using the low-level file I/O functions fopen(), fread(), fprintf(), and fclose(). An example of how to do it: ...

4 years ago | 0

| accepted

Answered
Create a Vector based on the Value of another Vector
u_permno = unique(permno); N = numel(u_permno); date_vectors = cell(1,N); price_vectors = cell(1,N); for ii = 1:N i...

4 years ago | 0

| accepted

Answered
How to plot a curve with 3 points?
You can plot those three points and connect them with line segments using the plot() function: x= [1.2 1.5 1.9]; y=[5.5e15 9.9...

4 years ago | 0

| accepted

Answered
Format adjustment for combination of line and area figures
To get the grids on top of the areas, set the 'Layer' property of the axes to 'Top': figure() area([0.2:0.1:0.9 0.98]+0.02,[11...

4 years ago | 0

| accepted

Load more