Answered
Hello, please help me with and advice about conditional statement
I would program it like this % compute Q1 with formula 1 ... Q1 = ... % compute Q2 with formula 2 ... Q2 =...

9 years ago | 0

Answered
How to convert arrayfun to for loop
count = 27; Length = 1:count; for n = 0:count-1 Array(n+1,:) = circshift(Length, [0, -n]); end

9 years ago | 0

| accepted

Answered
sort a one dimensional array ascend and descend
It is consistent behaviour: You explicitly ask to sort a 1xn vector along the first dimension. I think it would be nice if Matla...

9 years ago | 0

Answered
Creating a cell structure from directory file names
datedir = dir('directorygoeshere'); filenames = {datedir.name}:

9 years ago | 6

Answered
How to plot a histogram from 0-255
I = imread('cameraman.tif'); imhist(I) shows values from 0 to 255. Do you change I after imread and before imhist?

9 years ago | 0

| accepted

Answered
help me to find two consecutive differentiation with respect to x?
If I remember my high-school algebra correctly, it's q = 3*(1-cos(pi*x/10))= 3 - 3*cos(pi/10*x) dq/dx = 3*sin(pi/10*x)*p...

9 years ago | 1

| accepted

Answered
Can I convert long binary strings into unique serial numbers of much shorter length?
You said that you generate the numbers, but you do not mention any constraints on the generation. Without any constraints, just ...

9 years ago | 0

Answered
Running exe files in Linux
Try system(strcat('sim/CySim_solver sim/CySim', ' > out'))

9 years ago | 0

Answered
Keep SURF features from many images
The most general form is [features{i}, valid_points{i}] = extractFeatures(a, points); if features is just a single numbe...

9 years ago | 1

| accepted

Answered
How do I construct a vector of complex numbers whose absolute value is not above 1?
You can generate a vector of complex number where the maximum absolute value is always 1: C = rand(1,10) + 1i*rand(1,10); ...

9 years ago | 2

| accepted

Answered
Index exceeds matrix dimensions.
What's the size of the A you read? It's probably less than 192. You can check using A = fscanf(f,'%g',[1 inf]); si...

9 years ago | 0

Answered
Importing matlab data in a loop using keywords from a cell
a1 = {'K01 mainEEG.mat','K02 mainEEG.mat','K03 mainEEG.mat', 'K04 mainEEG.mat', 'K05 mainEEG.mat', 'K06 mainEEG.mat'} a2 = ...

9 years ago | 1

| accepted

Answered
How to save to different column array
Y(:, all(isnan(Y))) = [];

9 years ago | 0

Answered
How can I remove left y-axis tick marks from the right y-axis, AND retain the top x-axis with MatLab 2015a?
So what's wrong with x=[1:100].';y=randn(100,1); % some dummy data to plot to make axes w/ differing ranges hAx=plotyy(...

9 years ago | 0

Answered
how to get data of one image in a Matrix of images
X = abs(gaborResult{5,5});

9 years ago | 0

| accepted

Answered
My rectangle should have a determined color represented by a value
50 and 75 are not valid colorvalues in Matlab. Valid is an RGB triplet in the range [0, 1]. So I assumed that 50 and 75 is an in...

9 years ago | 2

Answered
How to read map of RGB image by using imread?
If the value is empty, the image is not in a mapped format, i.e., RGB values are stored for each pixel (true color format), not ...

9 years ago | 0

Answered
Matlab to extract the n th diagonals in a Matrix
d = [2 4]; A(sub2ind(size(A), d, d))

9 years ago | 1

| accepted

Answered
For loop not starting at 1
If you set Max(7) = something, values Max(1) til Max(6) are set to zero if Max does not exists, or it keeps the values in Max(1)...

9 years ago | 0

| accepted

Answered
draw all line between nodes
Simple as line(X, Y)

9 years ago | 0

Answered
Display progression while reading a large tiff/image file
No, I don't think so. Waitbar needs a fraction of the total processing time, and you cannot implant this function into a build i...

9 years ago | 0

| accepted

Answered
Advantages and workarounds for using a main function for a project?
You're right: If use use build-in commands or Matlab function as your variable name, such as 'gamma', something strange happens:...

9 years ago | 0

Answered
why does text change color when using saveas() or print()?
http://de.mathworks.com/help/matlab/creating_plots/save-figure-preserving-background-color.html

9 years ago | 0

| accepted

Answered
Draw sphere with slats
function hemispherewithstripes clf Nstripes = 12; stripecolor = 'r'; Nhemicircles = 2*Nstripes; r =...

9 years ago | 0

| accepted

Answered
Question about for loops and immultiply
A fast method to create a white square is Z(800,600)= 0; Z(275:325, 375:425) = 1;

9 years ago | 0

| accepted

Answered
Write a function (Not a built-in function) that converts a given number n in base 2 to base 10
There is a nice oneliner that solves the problem: base10 = 2.^(numel(n)-1:-1:0)*n(:); If you use it, your task is to und...

9 years ago | 0

Answered
Is it possible to define the marker size of a rectangle (length/width)?
A rectangle is not among the markers. You have to draw it manually.

9 years ago | 0

| accepted

Answered
Move file into folder
Use the functional syntax of print to print directly to the dir print('-dpng', fullfile(newdir, ['Slice_' num2str(i) '.png'...

9 years ago | 0

Answered
angdiff doesn't work as documented
Have a look which angdiff you use which angdiff it may be function different from the angdiff in the Robotics Toolbox.

9 years ago | 0

Answered
calling the function dynamically - is it possible using eval or evalin
If you just have three functions, it's best to use [a,b,c] = data_sum(d,e) [a,b,c] = data_multiply(d,e) [a,b,c] = dat...

9 years ago | 0

Load more