Answered
I want to add a push button or a clickable link into a cell of table
You can use HTML to format a string in a |uitable|, however the <http://www.mathworks.com/matlabcentral/newsreader/view_thread/2...

13 years ago | 0

Answered
I want information on dateticks
datetick('x','mmm-yy')

13 years ago | 0

Answered
how to shorten this equation?
Sum for each row the odd columns (form1) and the even columns (form2): form1 = sum(K(:,1:2:end),2); form2 = sum(K(:,2:2:...

13 years ago | 1

| accepted

Answered
Functions
You should use a dedicated .m file for a function, i.e. the first line of a function is always (except comments): |function o...

13 years ago | 0

Answered
find repeating numbers
unNum = unique(data(:)); [n,bin] = histc(data(:),unNum); With your example you're not likely to find any repetition (y...

13 years ago | 1

Answered
TEXTSCAN - .csv - mutliple columns to a vector/double/matrix
I don't get strange results but expected behaviour of textscan. cell2mat(data(:,2:end)) or when importing: data = t...

13 years ago | 0

Answered
Memory Pre allocation, Dataset Array
One way: n = 300; names = arrayfun(@(x) sprintf('C%d',x),1:n,'un',0); dataset([{zeros(30,n)},names]) Or d...

13 years ago | 1

Answered
Cannot call java class from Matlab
I tried your example but I added the path manually to |$matlabroot\toolbox\local\classpath.txt| (on a new line simply add): ...

13 years ago | 0

Answered
Need to Automate multiple sinwave regressions of a dataset
I suggest to use non-scalar structures: % Some random inputs y = rand(501,1); sincos = rand(5,1); n ...

13 years ago | 0

| accepted

Answered
Galois Field
Check this submission: http://www.mathworks.com/matlabcentral/fileexchange/12542-galois-field-array-to-decimal-array-conversion

14 years ago | 1

Answered
Read .txt file with header
str = urlread('http://web.gvdnet.dk/GVD002139/151.txt'); data = textscan(str, '%s%s%f%f%f%f%f%f%s%s', 'HeaderLines',9,'Col...

14 years ago | 1

| accepted

Answered
reshaping 2D matrix into 3D - specific ordering
[r,c] = size(a); nlay = 3; out = permute(reshape(a',[c,r/nlay,nlay]),[2,1,3]); Yes, MATLAB does 'think' along rows...

14 years ago | 11

| accepted

Answered
Rare examples of confusing error messages
The guilty one: foo('') Undefined function 'foo' for input arguments of type 'char'. No inputs: foo Undefin...

14 years ago | 2

Answered
Implementing `dTgSen' command of Gauss in Matlab
Is this what you're looking for: <http://www.mathworks.co.uk/help/techdoc/ref/ordschur.html |ordschur|>

14 years ago | 0

Answered
Simple but elusive array question
[r,c,v] = find(a); out = accumarray([v,c],1,size(a));

14 years ago | 3

| accepted

Answered
using if to find a value in one variable, but then give you the value of a second variable
[val,idx] = max(Q) This is the row-wise maximum, i.e. along the rows for each column. |idx| says on which row the max is f...

14 years ago | 0

| accepted

Answered
Vectorization
diff(M) <= 0

14 years ago | 1

| accepted

Answered
extraction from notepad
Soluion with |textscan|: fid = fopen('C:\Users\Oleg\Desktop\test.txt'); out = textscan(fid,'%3s%*[^=]%f','Delimiter','='...

14 years ago | 0

Answered
cell array in matlab..
One of the many solutions: cellfun(@(x,y) str2double(x(y+1:end)),c, regexp(c,'=')) Let us know if the timings are fine...

14 years ago | 0

| accepted

Answered
Generating numbers from a multivariate standard normal distribution
http://www.mathworks.com/matlabcentral/answers/23173#answer_30456

14 years ago | 0

Answered
replacing the strings with a specific length in a cell
n = 3; idx = cellfun('prodofsize',a(:,2)) >= n; a(idx, 2) = {'m'}; Note, however that cellfun is a concealed loop.

14 years ago | 1

| accepted

Answered
Max / Min of sparse matrices
For the max you should not have any problems: % Find the max (along columns) [mmax,Imax] = max(A,[],2); [rmax,~,m...

14 years ago | 0

Answered
slicing multi-dimensionsal arrays
Your input: A = cat(3, [1 2; 3 4], [10 20; 30 40], [42 3.14; 97 21]); 1. The |squeeze| removes all singleton dimensions:...

14 years ago | 0

| accepted

Solved


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

14 years ago

Answered
to retrieve data from a n*n matrix
*a)* data = x(:,1:end-1); histc(data(:),1:max(data(:))).' *b)* Why would you want to separate it when yuo can index i...

14 years ago | 0

| accepted

Answered
Matlab won't plot anything. please help why?
I did not preallocate, up to you. Keep things not dependent on the iteration outside of the loop. Also, this can be achieved...

14 years ago | 0

| accepted

Answered
Problems Generating Scrambled Quasi-Monte Carlo Numbers in Parfor Loops
Give a look at: http://blogs.mathworks.com/loren/2011/07/07/simpler-control-of-random-number-generation-in-matlab/ Especi...

14 years ago | 0

Answered
Estimate the common logarithm of 10 using linear interpolation.
step = 0.1; log10(8:step:12)

14 years ago | 0

| accepted

Answered
Bootci usage: passing vectors into function
% Inputs y = randn(100,1); v1 = 1:10; v2 = 10:-1:1; % Only 'x' is the input since we fix v1 ...

14 years ago | 0

| accepted

Answered
Use cells or char with if command
String comparisons should be carried out with <http://www.mathworks.co.uk/help/techdoc/ref/strcmp.html |strcmp|> if strcmp(...

14 years ago | 1

Load more