Respondida
'Linewidth' property with Histogram function
stairs(counts, 'LineWidth', 2)

más de 10 años hace | 0

Respondida
Error: subscripted assignment dimension mismatch for loop
The error occurs because you try to assign an image (2D) to a row (1D) img(i,:). You can use img{i} = imread(mhi_fig); ...

más de 10 años hace | 0

Respondida
How do I find variable values for functions?
Use logical indexing: time_where_height_is_zero = time(height == 0)

más de 10 años hace | 0

Respondida
how to plot a histogram of repeated values in a matrix?
This computes how often each value occurs [a b c] = unique(X); [X(b) histc(c, 1:max(c))]

más de 10 años hace | 0

| aceptada

Respondida
How to find the median of one part of a column being in a while loop?
A solution without a while loop; if now values are given for the year, NaN is assigned: for i = 1:size(A1,1) A1(i,2)...

más de 10 años hace | 0

Respondida
norm() - Subscript indices must either be real positive integers or logicals.
Make sure that you have not used any of these as a variable which norm which abs which acosd which dot

más de 10 años hace | 2

| aceptada

Respondida
'Fill' function with coloured lines instead of filling area
http://blogs.mathworks.com/pick/2011/07/15/creating-hatched-patches/

más de 10 años hace | 0

Respondida
deletion of first row in the matrix
Use ; to separate rows Ki = [25 35; 56 41; 85 78]; Delete first row Ki(1,:) = [];

más de 10 años hace | 0

| aceptada

Respondida
How i display matrix ?
disp(Ki(:,2))

más de 10 años hace | 1

Respondida
How can delete same rows and colums from three 2D matrices?
ind = isnan(A); longitude(:, any(ind)) = []; % delete columns longitude(any(ind'), :) = []; % delete rows

más de 10 años hace | 0

Respondida
How do I change the matlab so that data is written in one column and several lines?
I do not know of a "standard to record the data of a variable in a row and multiple columns"; what application are you referring...

más de 10 años hace | 0

Respondida
what is the simplest way to add two vectors if size is unknown?
You can use the colon operator : to convert the 1XN or Nx1 vectors v and u to Nx1 and then add both x = v(:) + u(:);

más de 10 años hace | 1

Respondida
how to get the final shape of a function after you got the variables?
X = [1 2 3]; % sample values X(1) = 1, X(2) = 2, X(3) = 3; % evaluate function for these values f1= [-3*X(1)+X(2)+X(2).^3; ...

más de 10 años hace | 0

Respondida
Hi Everyone! I'm trying to have a for loop that will repeat the question when the input value is greater than or less than to required value
This results in a string w of v characters: v=input('NUMBER OF KEYS TO ENTER: '); w=input('ENTER KEY/S: ' ,'s'); while l...

más de 10 años hace | 0

Respondida
Vector Matrix multiplication (Row wise)
L = L.*repmat(V, [1 N]);

más de 10 años hace | 1

| aceptada

Respondida
Binary table - counting bits in rows
table= dec2bin(0:(2^4-1)) - '0'; Nones = sum(table, 2); table(Nones==2, :)

más de 10 años hace | 0

| aceptada

Respondida
create n k matrix in matlab
If E, A, L are matrices and the ith stiffness matrix is just the scalar s = E(i)*A(i)/L(i)) multiplied with matrix [1 -1; -1 1]...

más de 10 años hace | 0

Respondida
create an Binary matrix table
That's easy: table= dec2bin(0:(2^4-1)) - '0';

más de 10 años hace | 4

| aceptada

Respondida
Currency conversion using matlab script - i have no idea how to start with this
SGD2X = [0.70991 0.23 5.3444 9.000]; % put the actual values here to convert from Singapore Dollars to USD, British Pound et...

más de 10 años hace | 0

Respondida
Pixel is a 2D or 3D? please answer me. thanks
A pixel is a "picture element", or the basic element of a digital image. The most common image formats are binary images, where...

más de 10 años hace | 1

Respondida
Plotting a graph in matlab
If you have the values in a matrix X, use plot(X')

más de 10 años hace | 0

Respondida
How to define a multivariable function (for instance an anonymous function) of a number of variables that varies according to the size of an array variable?
Define your function as function y = myfun(a,b) A = [-a a; a -a]; % sample definition B = rand(2); C = [-2*b b; ...

más de 10 años hace | 0

| aceptada

Respondida
How do I write a function that behaves differently according to the number of input arguments?
Use varargin as the parameter of your function that collects all arguments as elements of a cell array. function myplot(vara...

más de 10 años hace | 0

Respondida
Why am I getting an error "vectors must be the same length"
It's a typo; your last x must be x1 plot(x, f(x), x1, f(x1))

más de 10 años hace | 0

| aceptada

Respondida
What is the problem with the heaviside function?
The error means that Matlab cannot find the heaviside function. Try which heaviside to locate the function. The heavisid...

más de 10 años hace | 1

Respondida
Some question about logic of programm
The first index you need is the row of the first occurrence of your desired number num in column 1 of W num = 1; ind1 = ...

más de 10 años hace | 1

| aceptada

Respondida
how to write Loops in Functions?
It is not entirely clear to me what you want to achieve. If you want to use Fx instead of x, write F=[Fx(1)+Fx(2); 3*Fx(...

más de 10 años hace | 0

Cargar más