Question

How to produce graphs out of the following code?

The cost matrix stands for the connectivity and the distances among nodes. % cost=[ x x x 0 0 0 % 0 x 0 0 0 0 % 0 0 x...

ongeveer 5 jaar ago | 1 answer | 0

Question

Replace repeated pattern in text

I wrote the following code for a file that I attach, but it is not working. filecontent = fileread('C:\Users\User\Desktop\D...

ongeveer 5 jaar ago | 1 answer | 0

Question

What wrong with the code?

I want to create a data structure to find unique unsorted values, from an initial vector. I am doing something wrong. y = ...

ongeveer 5 jaar ago | 1 answer | 0

Question

Close MATLAB from the keyboard

I would like to save a file or close it automatically by running a command. Something like: keyboard ("EXIT")

ongeveer 5 jaar ago | 3 answers | 0

Question

Strfind to contain complex pattern

I have created the following program to search for sentences. I want to include those that only begin with vowels. a = 'Jo...

ongeveer 5 jaar ago | 1 answer | 0

Question

Problem with reading text file and making changes

I have a file in a txt format with the following data 0 584547.75 4052042.76 1 584543.25 4052030.13 2 584542.06 40520...

ongeveer 5 jaar ago | 2 answers | 0

Question

What is wrong with the code?

I want to remove the vowels and I am doing something wrong. chr = 'The fast black dog' for i = 1:length(chr) if c...

ongeveer 5 jaar ago | 1 answer | 0

Answered

Problem with reading text file and making changes

I have found the answer: M = dlmread('C:\Users\G\Desktop\topo.txt',' '); %replace path as appropriate M(:,1) = [] dl...

Problem with reading text file and making changes

I have found the answer: M = dlmread('C:\Users\G\Desktop\topo.txt',' '); %replace path as appropriate M(:,1) = [] dl...

ongeveer 5 jaar ago | 0

| accepted

Question

What is wrong with code?

I want a matrix as follows: n = 12 b = zeros(n,n) b(1,:) = 1:n b(2,:) = 1:n.^2 etc... How can I express th...

ongeveer 5 jaar ago | 1 answer | 0

Question

How to sum the digits of a string?

I have created the following program to sum the digits of a number, that derives from the following expression: op = 2^n, where ...

ongeveer 5 jaar ago | 1 answer | 1

Question

How can MATLAB find and replace a word in a text that contains multiple lines?

E.g. if there is a text file with 57 lines and I want a small change of a word in line 54.

ongeveer 5 jaar ago | 1 answer | 0

Question

Can I manipulate an existing Excel file through MATLAB?

I have an existing Excel file that has several mathematical operations into it. I want to insert several values through MATLAB, ...

ongeveer 5 jaar ago | 0 answers | 0

Question

Turning a row matrix of numbers into a row matrix of vectors.

I want to do something like this: I have the following matrix: A = [1 5 7] I want to turn it into: Anew = [1:6 (...

meer dan 5 jaar ago | 0 answers | 0

Question

Square matrix with relationships among equal rows.

I have a matrix with the following form: A = [ 9 9 9; 5 6 5; 9 9 9; 4 4 2; 5 6 5; 5 6 5; 4 4 4; 9 9 9] If a particular...

meer dan 5 jaar ago | 3 answers | 0

Question

I have three columns containing data. I want to isolate particular data depending on the third column and find the maximum values on the second column for each case of the isolated data from the third column.

I have a matrix with the following form: A = [1 2 3; 2 2 6; 0 1 3; 0 4 3] I want for each unique case from the third c...

meer dan 5 jaar ago | 1 answer | 0

Question

What is a code to remove elements that are identical between each other, in the 2 columns in a nx2 matrix?

If I have a matrix like: A = [2 5; 5 6; 1 1; 2 2; 4 8; 2 6; 3 3] What is a generalized code to remove the element...

meer dan 5 jaar ago | 0 answers | 0

Question

How do I break a complex loop with a multiple-if structure?

I am writing a code that has the following form: for i = 1:size(interiorcolumns,1) if interiorcolumns{i}(6) == height...

meer dan 5 jaar ago | 2 answers | 0