Respondida
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')

más de 11 años hace | 1

| aceptada

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

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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;

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 0

Respondida
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,...

más de 11 años hace | 1

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

más de 11 años hace | 0

Respondida
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 ...

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 2

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

más de 11 años hace | 1

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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.

más de 11 años hace | 1

Respondida
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]; % ...

más de 11 años hace | 1

Respondida
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).

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 5

Respondida
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 ...

más de 11 años hace | 1

| aceptada

Respondida
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(...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

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

más de 11 años hace | 0

Respondida
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(...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 1

| aceptada

Respondida
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...

más de 11 años hace | 1

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

Respondida
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])

más de 11 años hace | 0

| aceptada

Respondida
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; ...

más de 11 años hace | 0

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

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

Cargar más