Question

Remove data elements of the legend from figure

Hi, I have several figures in a loop-rich script in which the information of the legend would vary for most of the figures. I w...

3 mesi ago | 2 answers | 0

Question

Add s.f. to variable

Hi, I was wondering if there is a way to set specifically the number of s.f. to a variable as you do when printing the answer. F...

3 mesi ago | 1 answer | 0

Question

Only write floating points and/or avoiding scientific notation when using dlmwrite

Hi, I have this piece of code but it writes some of my outputs in scientific notation. I would like to keep the numbers as flo...

3 mesi ago | 1 answer | 0

Question

Data point missing in if statement

The following piece of code only plots 4 points and it should plot 5 (not 6 because two points overlap). I was wondering if you ...

4 mesi ago | 1 answer | 0

Question

How to add a column to an existing file?

Hi, I've been looking in other questions in how to add a new column to an existing file but none of the codes work or are either...

4 mesi ago | 2 answers | 0

Question

two conditions for plotting

Hi, I have the following code but it is not doing what I want it to do yet. I was wondering if you could help me fix it. Ins...

4 mesi ago | 1 answer | 0

Question

add column to file with dlmwrite

Hello, is there anyway to add a column to an existing file using dlmwrite? I've tried to transpose it to add lines instead an...

4 mesi ago | 1 answer | 0

Question

Write column in .txt file

Hi, I would like to know how can I write a column into a .txt file. Let's say that the output is A = [0.045; 0.011; 0.003; 0....

4 mesi ago | 1 answer | 0

Question

if statement not working

Hi, my following piece of code does not work as it expected to and I don't know how to fix it yet. Any suggestions? Thanks! A =...

4 mesi ago | 1 answer | 0

Question

If statement for equal rows from two different files

Hello, I have two files. Let's call them IDEAL and TEST. Hypothetically, IDEAL contains the following data 4.1 5.3 0.02 0.4 ...

4 mesi ago | 1 answer | 0

Question

Change function name everywhere

Hello! I was wondering if there is a way to change the name of a function and simultanously change it in the scripts where it is...

4 mesi ago | 2 answers | 1

Question

Error bars in loglog plot

Hi, I just want to plot a single data point from which I have the upper, mean and lower values for my X and Y (shown below). I a...

4 mesi ago | 1 answer | 0

Question

How to find the maximum peak of histogram probability and error from true value?

Hello, I would only like to find the maximum peak of the probability, not more than one, plus determine its errors from the true...

5 mesi ago | 1 answer | 0

Question

Extrapolate best-fit line

Hello, This is a section of one of my plots. I am estimating the slope of the "crosses data", i.e. the star is not included ...

5 mesi ago | 1 answer | 0

Question

How to add string and number to a graph?

I would like to add the value of the estimated slope to my graph, but I don't know which command to use. This is what I've trie...

6 mesi ago | 1 answer | 0

Question

Min and Max gradient

Is there any function to find the min and max gradient out of sgima3 lines? Note: my data does not include uncertainties. I am ...

6 mesi ago | 0 answers | 0

Question

Plot as a decimal and not a fraction

xtext = ['$\it{\bf{(A_{B}C)^{',rats(m),'}}}$']; xlabel(xtext,'Interpreter','Latex','FontSize', 15 ) This is my code for my xla...

7 mesi ago | 1 answer | 0

Question

Create numerical table from text file

Here I attached one file from which I want to extract some values and place them on a table. Example, let's say I want the Elsas...

7 mesi ago | 1 answer | 0

Question

Copy file from one directory to another

Hi, So I am using this piece of code to copy some files with similar names from several destination paths (e.g. file03431314, ...

7 mesi ago | 3 answers | 0

Question

num2str with latex

Hi, so I have this label which works fine. However, I've created a function in which the exponent varies (1/4). Therefore, I put...

7 mesi ago | 1 answer | 0

Question

Errors for the slope and intercept

How can I get the uncertainty for the slope and intercept when using this code Const = polyfit(log10(x),log10(y), 1); m = Cons...

8 mesi ago | 2 answers | 0

Question

Force slope and return intercept value (assuming a non-zero intercept)

Hi, I would like to force a slope value and know the intercept for that particular slope value.... Const = polyfit(log10(x),...

8 mesi ago | 1 answer | 0

Question

How to select rows with a particular value form one text file and write desired rows in new file?

Let's say I have the following data 3 43.45 0.5 4 23.21 0.4 5 32.84 0.3 6 67.02 0.4 2 13.00 0.2 3 23.32...

8 mesi ago | 2 answers | 0

Question

How to perform an f-test on matlab ?

h0 = 0.43096; h1_m = 1/4; h1_e = 1/3; H_F_m = vartest2(h0,h1_m); H_F_e = vartest2(h0,h1_e); Code above giving NaNs

8 mesi ago | 1 answer | 0

Question

F-test using vartest2 is giving a NaN

Here's that section of the code h0 = 0.86192; h1_m = 1/4; h1_e = 1/3; H_F_m = vartest2(h0,h1_m); H_F_e = vartest2(h0,...

8 mesi ago | 1 answer | 0

Question

Write equation on axis label

Hi, I would like to know if there's a way of writing an equation as an axis label This is the one I want (A^2/B)^(1/4)

8 mesi ago | 1 answer | 0

Question

Exclude first 2 rows of .dat file when using load

I want to exclude the first two rows when using load data = load('file.dat') x = data(3:end,1); y = data(3:end,2); The one b...

8 mesi ago | 1 answer | 0

Question

Using a loop to change the source path and rename each file

Hi. So I wrote the following functinal code to rename one file from one particular path. I have 38 paths to which I would like t...

8 mesi ago | 1 answer | 0

Question

Rename file when using copyfiile

Hello, I would like to rename a file that I've just succesfully copied. The basic code is the following filename = 'myfilename....

8 mesi ago | 1 answer | 0

Question

How can I reduce error on loglog scale using linear regression?

This is what I am doing with my imported data. What can I do to reduce the multiplicative errors? I tried to adapt non-linear re...

8 mesi ago | 1 answer | 0