Question

How to delete the columns of a cell array if the last elements of the columns are zero

Hi All, I have a large cell arry PP with three rows and lots of columns as follows: 'A.txt' 'A2.bmp' 'A5.jpg' 1.1 1.3 1.4 ...

8 months ago | 1 answer | 0

Question

Open a jpg picture for each data point by clicking on the plot

Hi there. I have a simple 2D data set (x,y). Each point (xi,yi,i) (i=0,..n) corresponds to a JPG picture. The JPG names are (0....

10 months ago | 1 answer | 0

Question

replacing the content of a text file

Hi all. I have a text file "A.txt". I have a string S='Hello World'. How to delete from line 10 to the end of file in "A.tx...

1 year ago | 1 answer | 0

Question

Precision lost when change numbers to string

Hi I am trying to use the following to generate a string. A is is 1D array containing 4 real numbers that have large decimal pr...

2 years ago | 2 answers | 0

Question

Generate a single string from a matrix (or cell)

Hi. I have a vector A that is [1:5]' and also I have a string 'Hi'. (I just use a of length of 5 for simplicity, but can be la...

2 years ago | 1 answer | 0

Question

Logarithmic spaced vector with a known sum

How to generate n logarithmic(or geometric) spaced numbers between a and b such that sum of them be a real number A ?

2 years ago | 0 answers | 0

Question

Function counts using parallel Fmincon

Hello all, I would like to use parallel fmincon. The function receivea an input vector X, generates a file name say Filei.txt...

2 years ago | 1 answer | 0

Question

Only upper triangle part of plotmatrix function

Hello, Is it possible to only plot the upper triangle part of the matrix plots when using 'plotmatrix' function? matrixplot ge...

2 years ago | 1 answer | 0

Question

Delete lines n to m in many text files

Hello there, I have 500 text files with names R1.txt to R500.txt. How can delete lines 5002 to 5012 from all the text file...

2 years ago | 2 answers | 0

Question

parfor and persistent variables

Dear all, I have a matlab function that accepts a set of parameters say (query array), generates a unique input data (text) f...

2 years ago | 1 answer | 0

Question

Creating a Parfor loop for multiple function evaluation

Hello. I want to use parfor to reduce the calculation time for a loop I have by evaluating 6 functions at the same time. Could y...

2 years ago | 1 answer | 0

Question

Running an external program from matlab linux

Hello. I have an external program called Lin.exe. This program accept (read) one file and write to another file. In windows cmd...

2 years ago | 1 answer | 0

Question

Matrix calculation without a For loop

Hi. Suppose A is a 1D matrix of [1 by N], and D and C are two square matrix of [N by N]. I would like to calculate D and C with...

2 years ago | 1 answer | 0

Question

Merge two arrays one after each other by elemnets

I have an array a1=[1 2 3 4 ... 50] I also have string '*GOAL' I want to create a single string B that can produce: *GOAL...

2 years ago | 1 answer | 0

Question

generate a matrix from some vectors

Hi, I have an array A0 (with 1 by n elements), representing a sample with n variables. I also have two arrays LB and UB (each...

2 years ago | 1 answer | 0

Question

Repeat a string several times and put it somewhere in a text file

1.a: I have a piece of code that generates a particular text 10 times (see below), how can I do this without a loop? 1.b. I h...

2 years ago | 1 answer | 0

Question

How to select diagonal subplots of fig1 and put them into a new fig subplot

I have a figure with 17*17 subplots. How can I select the diagonal subplots of this figure and put them into a new figure with s...

3 years ago | 0 answers | 0

Question

too many subplots- not visible output

I have a matrix of 17*17 subplots as an output of a process. When I run the script to show the matlab figure with subplots, they...

3 years ago | 1 answer | 0

Question

The global variable is lost between workspaces

I have written a matlab file (base.m) for an optimization problem that uses the genetic algorithm also in which I declare a glob...

3 years ago | 1 answer | 0

Question

Does fmincon implement any types of self-scaling approach for BFGS or LBFGS?

Do you have any idea that if matlab's fmincon with "BFGS" and "L-BFGS" is using any type of self-scaling of Hessian at each iter...

3 years ago | 0 answers | 1

Question

Replace a string in a file with a 1D array--please don't close it

Hi all, Please help me with this question. I have been trying to find a simple way to do so. Please don't close this. I ha...

4 years ago | 0 answers | 0

Question

Replace a string in a file with a 1D array but in multiple lines

Hi all, Please help me with this question. I have been trying to find a simple way to do so. I have a 1D number array wit...

4 years ago | 1 answer | 0

Question

replace a string by a cell array in a text file

Hi, I have a text file 'TEXT.txt' with the following format DATA [$1] / I would like to use strrep('TEXT.txt', '[$...

4 years ago | 2 answers | 0

Answered

Find array elements that meet a condition an put them in a secondary array

Thank you for your help. As a secondary filtering on B, I would like to only retain the rows when the first element of any ro...

Find array elements that meet a condition an put them in a secondary array

Thank you for your help. As a secondary filtering on B, I would like to only retain the rows when the first element of any ro...

4 years ago | 0

Question

Find array elements that meet a condition an put them in a secondary array

Hello all, I have a 3D matrix A. For example suppose that A is as follows: A(:,:,1) = 0.1835 0.0811 0.4359 ...

4 years ago | 5 answers | 0

Question

Write a 1D matrix to a text file such that only 6 numbers printed in each line

Hello all, I have a long 1D matrix A for example say: A=A[1,2,3,4,5,6,...,21]; I want to write this matrix in to a tab delimit...

4 years ago | 1 answer | 0

Question

Many subplots: none of them are shown

Hi I have a matlab file that generates an upper triangle matrix of subplots. However when I try to run the script and open it ...

4 years ago | 1 answer | 0

Question

Using fmincon kills my computer by using all the memory of the PC (24 GB) for a 20-d problem

I am using fmincon for a 20-dimensional problem. My function is a costly function but definitely doesn't need so much memory...

4 years ago | 0 answers | 0