已解决


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

9 years 前

已解决


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

9 years 前

已回答
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 ...

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 1

已回答
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...

9 years 前 | 12

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 0

已回答
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 ...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 5

| 已接受

已回答
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 ...

9 years 前 | 1

| 已接受

已回答
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. ...

9 years 前 | 0

已回答
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...

9 years 前 | 1

已回答
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...

9 years 前 | 1

已回答
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...

9 years 前 | 3

| 已接受

已回答
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); ...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

| 已接受

已回答
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 = (...

9 years 前 | 0

已回答
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 ...

10 years 前 | 0

| 已接受

已回答
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). ...

10 years 前 | 1

| 已接受

已回答
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...

10 years 前 | 1

| 已接受

已回答
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...

10 years 前 | 1

已回答
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...

10 years 前 | 3

| 已接受

已回答
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...

10 years 前 | 0

| 已接受

已回答
Using MapReduce with german CSV format
newStr = regexprep(str,',','.'); http://www.mathworks.com/help/matlab/ref/regexprep.html

10 years 前 | 0

| 已接受

加载更多