Community Profile

# Joseph Cheng

Last seen: Today Active since 2014

Systems Engineer for Electro-Optical Systems

All

View badges

#### Content Feed

View by

Answered
How do I pass coefficients to function handle as an array or list?
i think you just answered yourself in your question y = @(y0,a,b,NN) y0 + a*x(NN) + b*x(NN).^2; %simulate parabolic data yDIF...

23 Tage ago | 0

| accepted

Answered
Issue in plotting binary image boundaries with real axis values
so you'll need to find the conversion between pixel to linear xy (mm). sort of the mm/px scale factor + offset to 0; from th...

24 Tage ago | 0

Answered
how can i automatically crop this image? if it is possible.
well, you can find the corner squares by doing the following: img = (imread('https://www.mathworks.com/matlabcentral/answers/up...

24 Tage ago | 0

| accepted

Answered
Create variable with name from other variable string
While it is not adviseable to have variables created in this way maybe you have a good reason to but still un-adviseable but her...

28 Tage ago | 1

| accepted

Answered
How to find end of time series in plot
to go with your example of pos where pos = [0.11, 0.12, 0.12, 0.12, 0.12 0.12, 0.14, 0.14, 0.11, 0.16, 0.13, 0.13, 0.13, 0.13]...

30 Tage ago | 0

Answered
remove empty rows of a cell
you can use the function cellfun() in conjunction with isempty: clear K %generate dummy K for Cind = 1:2 for Rind = 1:4 ...

etwa ein Monat ago | 0

Answered
Issues in For loop
if we break down your for loop: for i=1:38976; %this if statement will be done if j==120 %an okay statement here b...

etwa ein Monat ago | 1

| accepted

Answered
How to find the two minimum values ?
well to remedy this you shouldn't "delete" the entry of the min point but stick in a large value or Nan and use nanmin(). by de...

etwa ein Monat ago | 0

Answered
3d to 2d matrix
take a look at the function squeeze() for ind = 1:3 val(1,1,ind)=-ind; end disp(val) u2 = squeeze(val); disp(u2)

etwa ein Monat ago | 1

| accepted

Answered
How to get data points within current camera view?
So... if i'm not mistaken pan in matlab moves the axes limits of the plot and not panning/translating the camera, similarly zoom...

etwa ein Monat ago | 0

Solved

Find the Pattern 1

etwa ein Monat ago

Answered
Looking for a way faster than find?
without doing some testing to actually test if its faster you can use the found 1's in a to only select a list of indexes A = ...

etwa ein Monat ago | 0

| accepted

Answered
Incorrect datatip location on interpolated data
so you can see what is happening if you plot it as just markers in this animated example: figure; hold on; hPlot = plot(1:10, ...

etwa ein Monat ago | 0

| accepted

Answered
Taking average of pixel values across multiple frames
couldn't you just put it into a non cell matrix of 5504 x8256 x 3 then use mean(data,3) to take the mean in the 3rd dimension? o...

etwa ein Monat ago | 1

Answered
Why am I getting an invalid file identifier error when using "parfor" but the same function works fine (albeit slow) with "for"?
From the looks of it you've opened a file then trying to use parfor to grab items out of the opened file. However thats where t...

etwa ein Monat ago | 0

Answered
How to get rid of blank space in a heatmap panel of 3 figures?
have you looked at the functions axis equal or axis square those might be applicable to you and not have to only use top h...

etwa ein Monat ago | 0

Answered
How read in comment style to skip the header of a text file?
you can quickly scan the file(s) for the number of header lines like file= 'Graphite_Node_test.txt'; fid = fopen('Graphite_Nod...

etwa ein Monat ago | 0

| accepted

Answered
Contour is plotting my data in reflected order?
From a quick test you might not be asigning the x and y values when performing your contour() function. by doing so matlab will...

etwa ein Monat ago | 0

| accepted

Answered
Create a matrix with elements clockwise
While probably not the most efficient way you can fill in edges like i've done here: clc;clear all x = zeros(5,8); %generate m...

etwa ein Monat ago | 1

Answered
Update a for loop with if statements
Without running your code i think you can create a sign variable of (-1)^(0 or 1) which switches between 0 or 1 depending on whe...

etwa ein Monat ago | 0

| accepted

Answered
Represent array in percentage
you would take your array, subtract the minimum, then divide by the resulting maximum x 100 x = [2.4:.4:4.2]; x = x-min(x); ...

etwa ein Monat ago | 1

| accepted

Answered
How to make the length/dimension of 6 different 3D vectors the same?
probably the easiest way is to fill a zero array created to be the same max size then populate the indexes with the values: var...

etwa ein Monat ago | 1

| accepted

Answered
Extract pixel values inside a Binary Mask
since you already created a binary mask you can just index multiply " .* " the mask with the original image as outside is 0 and...

etwa ein Monat ago | 0

Answered
how to color and label only certain histogram bars?
Here is an example for @Adam Danz said with using bar y = randn(100); [N X]=hist(y(:),10); %plot all the data figure,clf,hb...

etwa ein Monat ago | 1

Answered
Looking for a matlab script that extracts data from a plot figure ( here 2D contours from Covariance matrix or Markov chains) and reproduce the original figure
your graph is a bit messy with text and lines that denote items. here is a quick example that may push you along. It'll need a...

etwa ein Monat ago | 0

| accepted

Answered
Scientific notation at y-axis with yticks/yticklabels
from the looks of it the desired state is also plotting in a log10. you can change the current axis by set(gca,'yscale','log'...

etwa ein Monat ago | 0

| accepted

Answered
Find the indices of the imaginary element of the matrix
you can do a comparison to the real(A) like A=[1 2 3; 4+i 5 6-i; 7 8+i 9] [row col]=find(A~=real(A)) ...

etwa 2 Monate ago | 0

Answered
How to make the code efficient?
You can do things all at once cine you're not dependent on previous values. n=4 x=[0:n-1]; y=[0:n-1]; k = 0; %%Orig_code ...

etwa 2 Monate ago | 0

Answered
Double sigma with exception case
in your nested forloop you can put a check in for if j==i then continue. you do have a check up there with i~=j which should w...

etwa 2 Monate ago | 0

| accepted

Answered
Remove shadow and unwanted background
to get your started you can see that the tissue and the shadow area have similar values in all the color channels. you can do a...

etwa 2 Monate ago | 0