Answered
Extracting data from several txt files
Use the Import Tool (right click on one of the files and select "Import Data"). Select the range that you want and then under t...

12 years ago | 0

Answered
How to generate a single vector of block-consecutive values from 2 vectors of same size without a loop ?
There's also <http://www.mathworks.com/matlabcentral/fileexchange/29854-multiple-colon FEX:mcolon> which does exactly what you'r...

12 years ago | 2

Answered
How to make a linear regression line?
If you go to "Tools" -> "Basic fitting" in the figure window you can add the line and the equation: <</matlabcentral/answer...

12 years ago | 5

Answered
Getting Date from fints object
You can index into the date using . notation: data = [1:15]' dates = [today:today+14]' tsobjkt = fints(dates, data) tsob...

12 years ago | 0

Answered
Error: Undefined function 'minus' for input arguments of type 'cell'
You cannot subtract cell arrays. Perhaps you meant to subtract the contents of the cell array? % Two cells C = {1} C2 ...

12 years ago | 2

Answered
How do I sum a number with only the top row of the matrix?
x(1,:) = x(1,:) + -10

12 years ago | 1

| accepted

Answered
How to change both the axis value ranges
Set the _'XTick'_ and _'XTickLabel'_ manually sphere set(gca,'XTick',linspace(-1,1,6)) set(gca,'XTickLabel',cellstr(strca...

12 years ago | 0

Answered
How to repeat the rows of a matrix by a varying number?
I'd expect a |for|-loop to be faster than building and converting a cell array. Here is a pure indexing approach: A=[2 1; ...

12 years ago | 0

Answered
Can we use any other variable than symbolic to solve an equation?
What are you trying to do with it? If double precision is not enough, look into John's <http://www.mathworks.com/matlabcent...

12 years ago | 0

Answered
Include Simulink model Image when publishing an mfile
You can use |open_system| to open the system. Then publish will handle it automagically: %% open_system('vdp') ...

12 years ago | 2

Answered
How can I efficiently perform a curve fitting a large number of times without a constant 'for loop'?
If you have the Optimization Toolbox, use |lsqcurvefit| rather than fit. It will be faster.

12 years ago | 0

Answered
integration of (1/x-x)^alpha
1./1-1 yields a 0 and then 0 raised to any negative power is inf. What do you expect at 1?

12 years ago | 0

Answered
Calling out data that loops back around
Find the index of the maximum x value and keep everything from then on out: x = [1:10 10:-1:1]; y = flip(cumsum(x)); ...

12 years ago | 0

Answered
How can I copy the metadata from one dicom to another?
Perhaps I'm missing something, but can't you read the image in and then write it out with modified info? For example: in...

12 years ago | 0

Answered
how can I get currency exchange from yahoo finance and google finance?
You'll want to specify the date ranges to yahoo's fetch: <http://www.mathworks.com/help/releases/R2014a/datafeed/yahoo.fetch....

12 years ago | 0

Answered
any logic to do this programming on random number
I would take a different approach. First generate the 30 numbers who you must sum to: xsum = rand(1,30)+3.55; Now gener...

12 years ago | 0

Answered
Dicom-Dict.txt on MCR
fullfile(ctfroot,'toolbox','images','iptformats') ?

12 years ago | 0

Answered
Extract data from excel using heading
Use a |table|, that way you can index by variable name. <http://www.mathworks.com/help/releases/R2014a/matlab/ref/table.html>...

12 years ago | 0

Answered
sub2ind, picking specific values from a 3d matrix
|sub2ind| is slow, if you want performance, use a |for|-loop. % Data X = randn(500,8,4); % z Y = randi(8,500,1); % id...

12 years ago | 0

| accepted

Answered
How to extract a number of diagonals of a matrix
Or |triu| and |tril| x = magic(10); n = 3; x = x(tril(ones(size(x)),n)&triu(ones(size(x)),-n))

12 years ago | 0

Answered
Making a splash Screen for my Gui program
In R2014a, you can select a custom splashscreen icon in the application compiler app: <http://www.mathworks.com/help/releases...

12 years ago | 0

Answered
Is there a tool/method to determine the versions of Matlab my code is compatible with.
The release notes have all of the changes mentioned: web(fullfile(docroot, 'matlab/release-notes.html')) (or <http://www...

12 years ago | 0

| accepted

Answered
Calculate max(diff(A)) fast and memory efficient.
You could do a hybrid approach and loop from 1:4 (or 10 or whatever), calculate max(diff(x(of that range of x)) and then keep th...

12 years ago | 1

Answered
what's the program mistake?
w = sym(zeros(3,1)) You preallocated w as a numeric type and then tried to stuff a sym into it. If you preallocate w as a ...

12 years ago | 0

| accepted

Answered
Maximisation of a box cut on 4 sides
Something like: V = @(x)-(20 - 2*x)*(30 - 2*x)*x x = fminunc(V,0)

12 years ago | 0

Answered
after fundamentals what is the next course for a physics student?
How about getting a book on finance, making millions of dollars, and then doing whatever you find to be the most interesting? ...

12 years ago | 0

Answered
Remove zeros and perform calculation with non-zero elements
Extract the elements in C where B is nonzero D = C(B~=0) Extract the nonzero elements of B into D D = nonzeros(B)

12 years ago | 6

Answered
Data storage using structures/cells
I might look into how they did it here: <http://www.mathworks.com/matlabcentral/fileexchange/15728-timesplitrinex> But yes...

12 years ago | 0

| accepted

Answered
Keyboard shortcut to evaluate current line?
I don't know of this option but I do understand the use-case and agree that it would be valuable. Here's how I do it right now:...

12 years ago | 1

Answered
GUI does not recognize existing handles after using addlistener
More than likely the second figure is created because you use one of the |get current *| functions: gcf gca gco etc....

12 years ago | 0

| accepted

Load more