Answered
how to generate a matrix of 1 by L dimentions contains complex data from real and imaginary components
L = 20; your_mat = randi(100,1,L) + randi(100,1,L) .* 1i;

13 years ago | 1

| accepted

Answered
How to change array to be a special matrix ..??
Ar2Mat = [ 2 0.5 6 7.3 15 5.6 4 3.3 12 8.2 ]; Ar2Mat = reshape(Ar2Mat,2,5)' Are you taking the same course as <...

13 years ago | 2

| accepted

Answered
How can I convert an array to a matrix?
B=[2 3 1 5 2 8 1 7 9 10 5 21 4 6 3 9 3 1 7 0 7 2 8 6]; A = reshape(B,8,3)'

13 years ago | 2

| accepted

Answered
How to make one contour transparent in contourf?
[C,h] = contourf(peaks(20),-4:1:4); allH = allchild(h); valueToHide = 1; patchValues = cell2mat(get(allH,'UserData'))...

13 years ago | 1

| accepted

Answered
Multiple Font Sizes in title: (Mixture of latex and English commands)
plot(rand(10,1)); title(['\fontsize{20} Look Big' char(10) ... '\fontsize{10} Look small' char(10) ... '\font...

13 years ago | 3

| accepted

Answered
Warning: Unable to interpret TeX string
Matlab does not support the full set of latex commands. Please look for the _string_ property in _text properties_ to see the su...

13 years ago | 0

| accepted

Answered
Plot multiple graph using 'hold on' and loop function
n=0.1:0.1:1; x=0.1:0.1:3; [X N] = ndgrid(x,n); A = (1/3).^N; Y = A.*X.^N; plot(X,Y);

13 years ago | 0

Answered
Interactive Plotting - Get another plot via clicking point in current figure
Here is a script that will plot four lines and after that highlight the closest point to your click. To select a point use left ...

13 years ago | 1

Answered
loop for 3d matrix to numerous 2d matrices
You could try using a cell array instead: your_mat = rand(10,20,30); [m n o] = size(your_mat); your_mat = squeeze(mat...

13 years ago | 0

Answered
Quickly finding maximum value of a large (~8,000,000) vector
<http://www.mathworks.com/matlabcentral/fileexchange/23576-minmax-selection>

13 years ago | 1

| accepted

Answered
Can you change font size in LaTeX formatted comments?
text(0.1,0.5,... '$x(t) = \sum_{k=0}^N \frac{8}{\pi^2}(-1)^k \frac{sin((2k+1) 2\pi f_0 t))}{(2k+1)^2}$',... 'Int...

13 years ago | 0

Answered
How to find a vector in a matrix?
A=[1 1 1 1; 1 1 2 3; 1 2 3 1; 1 1 1 2]; B=[1 2 3]; isSubStr = @(x,y) ~isempty(strfind(x,y)); getStr = @(x) sprin...

13 years ago | 0

Answered
How to: xtick visibility
figure(1); aH = axes; hist(randn(1,1000)); set(aH,'TickDir','out'); Alternatively: figure(2); aH = axes; ...

13 years ago | 0

| accepted

Answered
how can i choose a certain row from simulation?
your_mat = [18 1 0 0 0;... 15 1 0 1 0;... 20 0 0 0 1]; idxFun = @(x) find(ismember(x(:,2:end),[1 0 0 0],'...

13 years ago | 0

| accepted

Answered
How can i keep the fontsize on colorbar when saving as JPEG, TIFF etc....
sH = surf(peaks); cH = colorbar; set(cH,'FontSize',30);

13 years ago | 1

| accepted

Answered
Random integer number generation
a = 1:10 a = a(randperm(numel(a)))

13 years ago | 1

Answered
read a file upto certain character
The documentation has examples that illustrate how _fread()_ works. Here is a (rather pointless) example of how to read a file b...

13 years ago | 0

Answered
I want to insert rows to matrix with condition
your_mat = sortrows([a;b]);

13 years ago | 0

| accepted

Answered
Short function to find min value in vector
_findm()_ is a built-in Matlab function. Rename your function to something else, e.g. _findmin()_. Even if you run your function...

13 years ago | 0

| accepted

Answered
How do I set the limit for one axis on 3D plot?
If _col1_ is your _x_ data: idx = col1>=400 && col1 <=750; lH = plot3(col1(idx),col2(idx),col3(idx),'k.'); aH = ancestor...

13 years ago | 0

Answered
Display checkmark string in figure
First set your system to display UTF-8 encoded characters: feature('DefaultCharacterSet','UTF-8'); Then plot it (look for...

13 years ago | 1

| accepted

Answered
2D plot of 3D data
Maybe _slice()_ is what you are looking for?

13 years ago | 0

| accepted

Answered
Determining the area of a hystresis loop
Yes, there are built-in functions to calculate the area of closed polygons: doc polyarea

13 years ago | 1

| accepted

Answered
can't multiply matrices
Please try to use the debugger. It is generally more efficient than to have us debug your code remotely and might save you a lot...

13 years ago | 0

| accepted

Answered
How to convert logical into decimal number?
a = randi(2,1,10)-1; a = logical(a); a = [{a};{a}]; %some cell array with logical values inside %Turning into a strin...

13 years ago | 0

Answered
Where in the axes properties (or elsewhere) is the "pointer" on the next color of ColorOrder ?
Maybe not exactly what you wanted but a workaround: fH = figure; aH = axes; lH = plot(rand(10,1),'r'); your_co...

13 years ago | 0

| accepted

Answered
Subscripted assignment dimension mismatch.
You are probably trying to assign a matrix to a scalar: split{1}(n)=test(:,n); _split{1}(n)_ is most likely a scalar _...

13 years ago | 0

Answered
help with the Matlab-C++ interface
# No # Solaris is a flavor of UNIX, so that's probably why it works # Yes, please save yourself a world of hurt and recompile...

13 years ago | 1

Load more