Community Profile

photo

grant


26 total contributions since 2018

grant's Badges

  • Thankful Level 2

View details...

Contributions in
View by

Question


Renaming files in directory that meet array criterion
Let's say I have some files in a directory my_directory: file_23.txt file_35.txt file_37.txt I'm reading the files through ...

9 days ago | 1 answer | 0

1

answer

Question


Check if values in array fall within certain integer of values in another array
Let's say I have a set of numbers in array A 11 22 35 41 and another set of numbers in array B 3 11 45 I want to check ...

16 days ago | 2 answers | 0

2

answers

Question


Renaming files if they meet certain array conditions
I have some arbitrary files in a directory "my_directory": file_1002.txt file_1012.txt file_1023.txt file_2045.txt each wit...

20 days ago | 1 answer | 0

1

answer

Question


Extracting values from file names to array
Let's say I have a directory "mydirectory" and in it, I have some files file_234.txt file_356.txt file_567.txt file_987.txt ...

20 days ago | 2 answers | 0

2

answers

Question


Determine whether file value is within certain integer of an array value
I have some arbitrary files in a directory "my_directory": file_1002.txt file_1012.txt file_1023.txt file_2045.txt each wit...

21 days ago | 1 answer | 0

1

answer

Question


Counting values between values in array
I have a variable, call it var, containing thousands of rows of numbers, like so: 123 124 125 128 % some values skipped 129...

1 month ago | 1 answer | 0

1

answer

Question


Forcing matrices to match in size
Let's say I have two single-row matrices A and B. I want to check if A and B have the same number of columns. If they do, do no...

2 months ago | 2 answers | 0

2

answers

Question


Why is my if statement breaking when condition is not met?
So I have a program that sets verbose to either 'true' or 'false' I have the code if (verbose == 'true') fprintf('VERBOSE ...

6 months ago | 2 answers | 0

2

answers

Question


Ignoring comments in lines when parsing
I am parsing a file with the following code: C = textscan(fid,fmt,opt{:},'CommentStyle','#'); This works in ignoring comments...

6 months ago | 2 answers | 0

2

answers

Question


Importing data from a file in a specific way
I have a file with 3 columns of data. Here is just a sample of what the data looks like (there are many more rows): 265.545555...

8 months ago | 2 answers | 0

2

answers

Question


Passing values to Bash script
Let's say I have a matlab file that calculates some values, giving: alpha = 7 beta = 9 Now, I want to pass these values to a ...

8 months ago | 1 answer | 0

1

answer

Question


Replace regular expression in file name
I want to use regular expressions replacement for file names in the following way. Say I have a string '/home/directory1/sub' ...

9 months ago | 2 answers | 0

2

answers

Question


Ignoring comments when parsing
I am currently parsing a file using the following scheme. fmt = '%s%s'; opt = {'Delimiter','='}; [fid,msg]=fopen(file,'rt'); ...

10 months ago | 1 answer | 0

1

answer

Question


Running Matlab script from another directory
I currently have a script with the following line. What it does is opens matlab and passes the file to mymatlabscript, then exit...

10 months ago | 1 answer | 0

1

answer

Question


Skipping elseif when first condition is true
I currently have the following scheme: if (a =0) q = 4 elseif (b=0) q = 5 rest of code end The problem is, in the case ...

10 months ago | 2 answers | 0

2

answers

Question


Printing just one column in text file in scientific notation
I am creating a text file with two columns of data using the following scheme: data = [a b] datafile = sprintf('file_%s.txt',l...

11 months ago | 1 answer | 0

1

answer

Question


Questions about producing text file with data
I have some data that contains two columns, and I want to print that data to a text file. This is my current scheme: fileID = f...

11 months ago | 1 answer | 0

1

answer

Question


Creating text file with columns of data
How do I create a text file with two columns of text correspond to columns of data? I currently have data = [a b]; % a and b ...

12 months ago | 1 answer | 1

1

answer

Question


Making one structure out of two structures
Let's say I have two structures. D = [strtrim(C{1}),num2cell(C{2})].'; F = struct(D...

12 months ago | 2 answers | 0

2

answers

Question


How to parse variables independent of order
I am currently opening a file and parsing arguments in the following way: ReadParam = 'h0 = %f f0 = %f'; fid = fopen(file); p...

12 months ago | 1 answer | 0

1

answer

Question


How to pass file from Bash script to MATLAB script
I have a bash script that creates a config file of varying name and then runs a Matlab script through the following: (config fi...

12 months ago | 1 answer | 0

1

answer

Question


Editing values in Matlab script from Bash script
Let's say I have a script called Histogram.m that performs a variety of functions. It has a variable named Detect that can be...

1 year ago | 1 answer | 1

1

answer

Question


Indexing values, selecting a range, and outputting values
Let's say I have two sets of data. A = [1 2 3 4 5 6 7 8 9 10] B = [4 5 2 8 9 0 1 0 4 6 ] Let's say I only care about va...

1 year ago | 1 answer | 0

1

answer

Question


How to pick and subtract specific elements in matrices
Let's say I have four sets of data (a,b,c,d). Arbitrary values chosen. a = [1 2 3 4 5 6 7 8 9 10] b = [0 4 2 8 5 5 6 2 1 9...

1 year ago | 1 answer | 0

1

answer

Question


How to plot separate scripts into one plot
If I have two Matlab scripts, for example "apple.m" and "ball.m" that plot with the same axes (just different data), etc. how ca...

1 year ago | 1 answer | 0

1

answer

Question


How to Open Script from Directory in Matlab
Hello, I am new to Matlab, so I am wondering how to open a script in a directory in Matlab. The directory is on a server. ...

1 year ago | 1 answer | 0

1

answer