Respondida
Changing names within a data
Dear Nora, you can do it the following way: ID = fopen('filename.txt'); a = textscan(ID, '%s%f%s%f'); fclose(ID); ...

más de 12 años hace | 0

Respondida
Using Power Iteration on a Large Matrix
Dear Alex, Of course MATLAB can handle it. The main problem comes not with MATLAB but with the processing capacity as well as me...

más de 12 años hace | 1

| aceptada

Respondida
draw picture with ezplot
Dear xinyu, yes you can plot as follows: syms beta omega Lambda rho rho = Lambda * omega + beta; rho2 = subs(rho, [La...

más de 12 años hace | 0

Respondida
Matlab "too many output arguments"
Dear Gilmar, I wrote a sample function which takes 20 inputs and gives 4 outputs as below: function [w, x, y, z] = myfoo(x1...

más de 12 años hace | 1

Respondida
As I can solve the following problem binary
Dear FRANCISCO, here is the code which performs the desired function: s = 1:100; % Your array n = 11; % Length of sub-ar...

más de 12 años hace | 0

| aceptada

Respondida
I take 4x4 blocks from the Gray image , filtered it and now i want to return it back to the original gray .
Dear Zgrt, you can do it the following way: gray3=dct2(gray2); gray4=gray3(1:4,1:4); IDCT_Gray=idct2(gray4); h = f...

más de 12 años hace | 1

| aceptada

Respondida
midpoint rule for integration
Dear Joe, re-write f as follows: f = @(x) (x.^3-1).^(1/2); Then code should work. I hope it helps. Good luck!

más de 12 años hace | 2

Respondida
Can I create an array of matricies?
Dear James. you dont need loop for this you can do it like this: array1 = rand(10, 1); array2 = rand(10, 1) * 2; ar...

más de 12 años hace | 0

| aceptada

Respondida
How to calculate fourier coefficients in Matlab
Dear Javid, here is the code for your problem: A = input('Enter value of A:'); B = input('Enter value of B:'); D = in...

más de 12 años hace | 0

| aceptada

Respondida
Attempted to access dz(1,1000); index out of bounds because numel(dz)=1.
Dear Alex, here is your working code, I made some modifications(If i understood correctly what you want to do): k = 0.5; ...

más de 12 años hace | 0

Respondida
Problem with a program concerning composite trapezoid rule
Dear Drake, re-write first line as: f = @(x) 1./(1+x.^2); then it should work. Good luck!

más de 12 años hace | 0

| aceptada

Respondida
How to make for loop ?
Dear Negar, try this: for j = 1:length(files) [signal,Fs,nbits,opts] = wavread(strcat('database/ae/ae_0a0', num2str(...

más de 12 años hace | 0

| aceptada

Respondida
How can i compress this code into some form of loop so that it is not so bulky?!
Dear Joel, you can make this code compact in the following way: s = 2; syms n i = 1:4; f = n.^i; fprime = i .* ...

más de 12 años hace | 0

Respondida
Having trouble implementing a function
It means you should input all four values for "f,tspan,y0,N" because your "euler" function has four inputs

más de 12 años hace | 0

| aceptada

Respondida
Is there a way to disconnect lines between data points while utilizing the plot function?
Dear Brad, you can do it the following way: x = [1;2;3;4;5;6;7;8;9]; y = [10;20;30;40;50;60;70;80;90]; plot(x(1...

más de 12 años hace | 0

| aceptada

Respondida
Loop not working? How can i save the total values wth out getting overwrite in the save file?
Dear Uday, you don't need loop in this case. You can do what you need directly as follows: a=input ('what is the a value?')...

más de 12 años hace | 1

Respondida
how do I plot one channel of data when I have 100 channels?
Here is the code for this: select_channel = 10; % select channel you want to plot M = rand(100, 300); % It is matrix which...

más de 12 años hace | 0

Respondida
Unable to run symbolic script, MATLAB is making fractions extremely large and unable to handle them
Dear Amit, here is the modified code: tic syms x1 x2 x3 a; f = x1^2+2*x2^2+2*x3^2+2*x1*x2+2*x2*x3; p=[1,1,1]; n...

más de 12 años hace | 1

| aceptada

Respondida
How do I plot this sine wave?
Dear Niamh, you can do the following way: time = -1:0.01:1; frequency = 97; phase = 97; phase_in_rad = degtorad(ph...

más de 12 años hace | 1

| aceptada

Respondida
from 8760 x 1 to 1 x 8760 ??
Dear you can do like this(if i understood correctly): num = xlsread('filename.xls', 'A:A'); ind = 1:length(num); matr...

más de 12 años hace | 0

Respondida
store the value in the variable
you can do like this: p = C(1,:) q = C(2,:) Or if you want to use for loop then you can do like this: p = zeros(...

más de 12 años hace | 0

| aceptada

Respondida
How do I split a color image into its 3 RGB channels?
If you want to show RGB channels in there original color then you can do like it: img = imread('filename.png'); % Read imag...

más de 12 años hace | 11

Respondida
Writing zero to text file
Dear Andrew, you can write the 0s in the text file in the following way: a = {'0.00000', '0.00000', '0.000000'}; ID = fo...

más de 12 años hace | 0

Respondida
Problem with symbolic math
Dear Amit, it is working fine: syms x1 x2 x3 gr = [2*x1 + 2*x2; 2*x1 + 4*x2 + 2*x3; 2*x2 + 4*x3]; p1 = [957/2500; -29...

más de 12 años hace | 0

Respondida
How to extract a part of a given vector and store it in a new vector using loops (for loop) ?
Dear Abhisek, here is the code for it: a = [1 2 3 4 5 6 7 8 9 10]; indices_of_values2save = [4 5 6 7]; count = 1; ...

más de 12 años hace | 0

| aceptada

Respondida
How to declare function?
Dear Mustafa, function y = calculate_sqrt(x) y = x .* (sqrt(x) - sqrt(x - 1)); end you can save it with th...

más de 12 años hace | 0

| aceptada

Respondida
Time to run programming
Yes you can use tic your code... toc See: <http://www.mathworks.de/de/help/matlab/ref/tic.html> and <http:/...

más de 12 años hace | 0

Respondida
r g b components of an image
Dear Shefali, one way to just show three separate color images is as follows: img = imread('filename'); figure, imshow...

más de 12 años hace | 5

Respondida
num2str not working for me
Dear Chris, you don't need to use num2str function in order to achieve your goal. You can solve this equation and also able to c...

más de 12 años hace | 0

Respondida
Write a function that produces a plot for the Cantor Set
Dear Jerry, here is the code which plotting Cantor Set: n = input('Input number of iterations:'); a = cell(1,n); for j = ...

más de 12 años hace | 0

| aceptada

Cargar más