Respondida
removing rows containing certain values
Seth, You can create logical indexes with conditional statements, and use the *&* for "and" as well as *|* for "or" to combin...

más de 8 años hace | 2

Respondida
writing each line of a text file in a cell array
Hi Shima, From context clues, I'm guessing "myfile.txt" is a space-delimited table of data. Your approach is useful if you do...

más de 8 años hace | 2

| aceptada

Respondida
How can I add XML attributes and corresponding values in line to RootNode
Hi Mateusz, You can add attributes directly to element nodes as well. I am providing code to create the < Attribute/ > node w...

más de 8 años hace | 3

| aceptada

Respondida
how can I plot single x-value of type string against multiple y-values of type double?
You could visualize the data in many ways. Here's a simple way scatter the data and label each series. % using random data ...

más de 8 años hace | 1

| aceptada

Respondida
if else, for loop, working with character variables
Two questions: 1. Is z.new initialized before you start assigning values to it? 2. Did you try curly braces? if z.LOA...

más de 8 años hace | 0

| aceptada

Respondida
Import Excel data into Matrix, then search Matrix for specified text?
Samuel, You should probably take some time to read up on <http://www.mathworks.com/help/matlab/getting-started-with-matlab.ht...

más de 8 años hace | 1

Respondida
how can I sort an array of elements corresponding to another array of elements in decreasing order?
Try this out: % sort A in descending order (decreasing A values) % and keep the sort index in "sortIdx" [A,sortI...

más de 8 años hace | 12

Respondida
How to select the row of an element in a vector and put it in the same row for a different matrix?
Here's an example of creating an index and using it appropriately: A = [1;2;3]; B = NaN(3,5); % find where A is e...

más de 8 años hace | 0

| aceptada

Respondida
is it possible to modify sudoku.m so that it counts how many times has called itself?
John, I'm not going to download the book or the sudoku.m file. Instead, here's an example called john_sudoku() with a recursi...

más de 8 años hace | 1

| aceptada

Respondida
I need help importing this complicated data set into MATLAB.
Drew, I made a text file called DrewL.txt which literally has the faux-data you posted in your question. I am using the forma...

casi 9 años hace | 0

Respondida
Limits in hours in date vectors (datevec function)
This appears to be a bug in datestr() which *you can report to Mathworks support.* In Matlab 2015a, datestr line 166 has an i...

casi 9 años hace | 1

| aceptada

Respondida
How do I create a matrix with the diagonals set to 10 and non-diagonals a random integer (0 to 2) where each row sums to 10 (without including diagonal)?
Here's a solution where you can change the values of matrix size, diagonal value, and non diagonal sum. Values between 0 and 2 a...

casi 9 años hace | 1

| aceptada

Respondida
Set environment path using IP for directory
I believe this post discusses the format you're looking for. http://superuser.com/questions/267844/full-uri-to-a-file-on-anot...

casi 9 años hace | 0

Respondida
Generate all possible combinations of a few numbers when the internal order doesn’t matter and the length varies?
You're asking for the power set of your data. Careful not to use large arrays since the calculation will get out of hand rather ...

casi 9 años hace | 0

| aceptada

Respondida
How can a plot from an "if" inside of a while loop?
Pre-allocate a large array to load values into during the loop. At the end of the loop, you can plot them all at once. I added t...

casi 9 años hace | 1

| aceptada

Respondida
How can I combine multiple excel files in a single new excel file?
Is D a local disk or a remote network disk? This will go much faster if you save the files locally before trying to read them al...

casi 9 años hace | 5

| aceptada

Respondida
Vectorization question (trying to avoid for loops)
I deleted the clear lines and switched the ( *t_max+1*) tendency to simply be *t_max*. I added *t_max* and *I* values up top so ...

casi 9 años hace | 1

| aceptada

Respondida
convert cell array of different data type char and number to matrix
You have several options. 1) If every cell in your cell array contains a scalar double value, cell2mat() will work properly. ...

casi 9 años hace | 0

Respondida
How can I extract a certain 'cluster' of elements according to a particular condition on the elements?
Assuming you only want to find submatrices along the diagonal of C, the following code extracts all square submatrices (>rho) in...

casi 9 años hace | 1

Respondida
how to read .DOT file in matlab??
deep, Matlab doesn't have any built in functions to read and render .DOT images. You could do this outside of Matlab using to...

casi 9 años hace | 1

Respondida
How to evaluate a cell of function handles?
Max, If your function handles can accept an array of x values and return an array of results, then your current implementatio...

casi 9 años hace | 3

| aceptada

Respondida
automating script using uiload
jakob, You can get the variables loaded in your workspace with the who command. Try out this example: m2 = magic(2); ...

casi 9 años hace | 0

| aceptada

Respondida
How to code for generating a crossword out of some given random letters?
The code from the top 5 submissions is available by clicking the *Title* links here: http://www.mathworks.com/matlabcentral/c...

casi 9 años hace | 0

| aceptada

Respondida
Plotting 3 matrix vs range curves
I don't know what the values of pcu or w are, but here's a simplification that works fine. t = 1e-9:1e-9:1000e-9; Rf = (...

casi 9 años hace | 0

Respondida
writing data to excel files
When writing to a row, specify your data as a row vector. When writing to a column, specify your data as a column vector. In ...

casi 9 años hace | 0

| aceptada

Respondida
Read data from .dat file
You've given textscan directions to read 5 columns where the first two are %u (integers) and the next three are %f64 (doubles). ...

casi 9 años hace | 1

| aceptada

Respondida
Plot title sprintf format pi
x is a double-precision floating point number. It will be displayed as a decimal by default. You can control how the double is r...

casi 9 años hace | 1

| aceptada

Respondida
Creating Matrix using two vectors and scalar
jack, Please read the <http://www.mathworks.com/help/matlab/ref/repmat.html repmat() documentation> to understand its interfa...

casi 9 años hace | 1

Respondida
Combine datasets of unequal lengths by matching dates
niki, You can do all of this quite easily if you first put your data into <http://www.mathworks.com/help/matlab/tables.html t...

casi 9 años hace | 3

| aceptada

Respondida
isequal functions is not working, what am I doing wrong?
In your Command Window, type this: format long A_T A_1 You'll see elements of A_T and A_1 are essentially the same...

casi 9 años hace | 0

| aceptada

Cargar más