Answered
How do I save multiple variables from the workspace as a .out file?
X = rand(10); Y = ones(3); dlmwrite('data.out', X); dlmwrite('data.out', Y, '-append')

11 years ago | 1

| accepted

Answered
How can I read Or Use txt file for Next Step?
X = dlmread('a_freq.txt'); [Y w] = tfidf2(X, 'Logarithmic');

11 years ago | 0

Answered
Undefined function or variable "Horz_average_l"
The last if seems to have no body. Please format all your code. Why do you use syms i j side Start End Where is P...

11 years ago | 0

| accepted

Answered
2 variables in a loop
You do not need a for loop, use piece-wise multiplication .* ic=0.1:0.1:95.5; c=ic.*Vm_1000;

11 years ago | 0

Answered
Graph figure wont show
Because your y is just a single point. Work on the whole vector and make sure to use .*, ./ and .^ when you want point-wise ope...

11 years ago | 0

Answered
Create matrix row element if row elements of two previous matrices are identical
In this example A is the large matrix and B the small one A = round(10*rand(10, 3)); A = [A; A(1:2, :)]; B = A(1:2:end,...

11 years ago | 1

Answered
How to create Array in structure??
s.a1 = rand(10); s.a2 = rand(20);

11 years ago | 0

Answered
displaying specific range of data with different color in a plot
I know of no other way as splitting the x into those different parts that you need to color differently. E.g., to plot negative ...

11 years ago | 0

Answered
Generic Variable Names and Cell Arrays
You should avoid organizing your data by using 16 different variables. Instead, you can use a 3D matrix M(r,i,:) where r runs fr...

11 years ago | 2

Answered
how to separate some pixel intensity values of a image matrix in matlab ?
Output = A(A > 100 & A < 230)

11 years ago | 1

Answered
hi i hav set of 100 images and i want to store its feture vector in 100 rows each image is having 9 features.so pls tell me some easy method...thanks
This pseudo-code should give you a hint how to start: for i = 1:100 imagename = ... % depending on how the images are n...

11 years ago | 0

| accepted

Answered
How do I average a data which runs on a cycle?
Read your data into one big 100xN matrix D (e.g., using dlmread) and then use mean(D). Voila.

11 years ago | 1

Answered
Neural Network for Random Sequence Generation
One way to do it would be to xor output 1 and 2 to get input 1, and output 3 and 4 to get input 2: output = [ 1 0 1 1]; % ...

11 years ago | 1

Answered
least square fit matrix dimension errors
You forgot to define alpha, delta, gamma; if they are rand(T,1); you have to use alpha(t), delta(t), gamma(t).

11 years ago | 0

Answered
readjusting Y limits on subplots
Do your plots and store the gca for each plot for i = 1:3 subplot(1, 3, i) plot(10*hist(rand(1, 100))); % some ra...

11 years ago | 5

Answered
solving matrix equation '[A]*(x)=(b) with variables at the x and b vectors
You have to convert the equation into a proper linear form. First you multiply x with A to get 1 + 2x = 0 2 + 1x = u ...

11 years ago | 1

| accepted

Answered
Issues using an efficient positivity constraint
I see. Than you can use your second code or (only one max, probably faster): temp = max(0,p_w); p_w_plus = temp./repmat(...

11 years ago | 0

| accepted

Answered
Issues using an efficient positivity constraint
To obtain values of 0 or higher, of course you can simply use p_w = abs(p_w); or p_w = max(0, p_w); Obviously t...

11 years ago | 0

Answered
Character to Binary function?
c = input('Enter a character > ', 's'); binvecc = logical(dec2bin(c, 8) - '0'); sprintf('%x', binvecc)

11 years ago | 0

Answered
How to generate random numbers of two correlated variables following lognormal probability distribution?
If N has a normal distribution, exp(N) has a lognormal distribution: x = -10:0.1:10; N = randn(1, 10^6); plot(x,hist(...

11 years ago | 0

| accepted

Answered
How do I get two images to display top and bottom of screen in Matlab/Psychtoolbox? I can already do left and right sides.
The values are the x,y coordinates of the top right coordinates of the rectangle the x,y coordinates of the bottom left coordina...

11 years ago | 1

| accepted

Answered
Find within string, location where space doesn't occur before upper (capital) letter
To get the indices ind = regexp(string, '(^|[^ ])[A-Z]'); To extract the strings from the indices L{1} = string(1:i...

11 years ago | 1

| accepted

Answered
Plotting points and lines
This should give you an idea how to solve it gplot(adj_matrix==1, m', 'bo-') gplot(adj_matrix==2, m', 'ro-') gplot(ad...

11 years ago | 0

| accepted

Answered
Problem to Read .txt file
You probably should first have a look at your .txt file to check if is has reasonable values, all separated by commas (or blanks...

11 years ago | 0

| accepted

Answered
Creating a large set of random numbers
You could split your random numbers into, e.g., 557056 vectors of 10^5 random numbers and iteratively work on each 10^5 element...

11 years ago | 0

Answered
Why is y-axis in loglog not 0?
If you do not have to use a loglog plot, semilogx may be useful semilogx(MockN1,MockF1,'o') ylim([0 250])

11 years ago | 0

| accepted

Answered
How to perform row wise operation for a matrix of 250x250
This is basically the algorithm suggested by Guillaume with an addditional check for the special case where the row has no 0's; ...

11 years ago | 0

Answered
Saving an array to a fits file
Reading the ith image: (adapted from the Mathwork's help for fitsread) info = fitsinfo('fitsfile.fits'); rowend ...

11 years ago | 0

Answered
Iterate through matrix until no more possible calculations.
Store the b, c, d arrays as cell elements in cell b. Then insert the i'th row of a into anew if its not element of any list in b...

11 years ago | 0

| accepted

Answered
How to add random valued impulse noise in the image?
To add uniformly distributed random noise you can use I = im2double(rgb2gray(imread('peppers.png'))); p = 0.2; % p betwe...

11 years ago | 0

| accepted

Load more