Réponse apportée
Add field to a double array?
My best guess is that someone is trying to restructure *obj.mu* that had a double array into one that has two fields instead. It...

presque 9 ans il y a | 0

Réponse apportée
Uniformly Distribute numbers on for loop?
Here's the vectorized form: rng(0, 'Twister'); a = -1; b = 3; x = randi([a, b], 100, 1); y = (x.^3) - sin(...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
How to get values from an array using another logical array
Instead of A(B) try A.*B

presque 9 ans il y a | 2

| A accepté

Réponse apportée
Compare and compile matching values from various data set.
First, do not label variables dynmically like data1, data2, data3, etc.. as this will make your function very complicated. In yo...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
Error due to using the same varname in mat file and matlab function
Try to load the variables into a structure to prevent "poofing" them into your workspace, which can cause issues with overriding...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Remove elements of a cell array if length<200
Y = Y(cellfun(@(x) length(x) >= 200, Y))

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How can I get the RGB values separately for an image taken using a webcam?
R = 255, G = 255, B = 255 is the RGB color for white when the data is in uint8 format( 0 - 255 ) values. The website below shows...

presque 9 ans il y a | 0

Réponse apportée
What is wrong with this code?
Here are some other comments about the code to help with readability, etc: Function dcm = dcm2vol(din) %<-- "function" mus...

presque 9 ans il y a | 2

| A accepté

Réponse apportée
loadind data loop fastly?
Not sure if this is faster or not, but your code could be simplified a lot. If you have parallel computing toolbox, you could di...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How to use find when some of the searches will not return a result?
A is a Mx3 matrix, but you are trying to access A as a MxNx3 matrix, ex: A( A(:,1)==Y(i,j), A(:,2)==X(i,j), 3) %A is not ...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
I have 12 matrices of 145x1.how to get 1740x1 matrix taking each values from the columns first
%======================================================================== %If you labeled your variables inconveniently lik...

presque 9 ans il y a | 0

Réponse apportée
Error when using isempty in a while loop
One issue you'll find is that the |input| will error out for number inputs such as: "1 2 3 4". If you only want string inputs, u...

presque 9 ans il y a | 0

Réponse apportée
How to change the style of the plot box outline without affecting axis style?
I can't seem to find a way to change the axes line color individually... Workaround would be to draw 3 axes and adjust the line ...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Why is compiled parfor repeatedly trying to start a parallel pool?
Your compiled application (which is pre 2016a) has access to parallel processing and will use the default parallel setting, whic...

presque 9 ans il y a | 0

Réponse apportée
How can I replicate elements of a vector of into another
v2 = [1 1 1 1 3 1 4]; vx = cellfun(@(x) repmat(x, 1, x), num2cell(v2), 'uniformoutput', false); v3 = [vx{:}]; v3 = ...

presque 9 ans il y a | 0

Réponse apportée
Mirror x-axis of Image but not the x-axis of the plot over top of it?
Try flipping the data stored in |im| instead of the x/y axes direction. im.CData = flipud(im.CData) %To flip image across...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How to display the elements of a matrix D as an input for the next matrix 729x729 rows and columns?
Maybe you can make your own data structure and get/set methods to access them by 6-tuple char: Tuple = fullfact([3 3 3 3 3 ...

presque 9 ans il y a | 0

Réponse apportée
Problems with the function plot
NEW ANSWER Somehow, setting to opengl renderer after Matlab starts causes an issue. I could replicate the bug if I do |op...

presque 9 ans il y a | 3

| A accepté

Réponse apportée
using textscan to separate columns by delimiter
Here's how to open a file separated by space. See example data.txt. FID = fopen(FileName, 'r'); %Open file to read, save th...

presque 9 ans il y a | 0

Réponse apportée
Why does my image keep disappearing from my GUI when I try to create a free hand mask?
NEW ANSWER For some reason, your gui is not saving the "crackdetection" variable prior to the Masking callback function. Your...

presque 9 ans il y a | 1

Réponse apportée
How can I convert matrix to cell array of strings?
You could use |sprintf|. mat = [1 2 3; 4 5 6 ; 7 8 9]; arr = cell(1, size(mat, 1)); for k = 1:numel(arr) arr{k}...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Create 58 graphs as a waterfall plot from 58 .csv files
You should use plot3 instead of plot to draw line in 3D. More info here: <https://www.mathworks.com/help/matlab/ref/plot3.htm...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Adding the elements of a field of a struct
To fix this, transpose column vector to row like this: output(activityNum).distanceininches = zDistance(startind:endind).';...

presque 9 ans il y a | 0

Réponse apportée
transparent background for scatter plot
imagesc will use the colormap of the figure, so if you want to use a different color scheme for scatter, calculate out the rgb v...

presque 9 ans il y a | 0

Réponse apportée
How do I store larger and smaller values in a matrix?
I'm guessing this is what you see: denum = 1.0e+014 * 0.0000 0.0000 1.0000 0.0000 0.0000 1.0...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
why do I have this error in index
You are accessing a matrix using a non-integer index right here, which is not allowed. Index must be an integer > 0. Another iss...

presque 9 ans il y a | 0

Réponse apportée
Loop for this program
Looks like |d| is a vector. You can use a logical array |( d < 27 )| to find where in |d| is under 27, and then use this logical...

presque 9 ans il y a | 0

Réponse apportée
Can anyone help in explaining how the below code is detecting rain streaks???
clc % clear command window clear all % clear all variables close all % close all figures I=imread('heavyrain.jpg...

presque 9 ans il y a | 0

Réponse apportée
For Loop Output as a Vector
a = [0; 1; 0; -1]; p4 = zeros(1, 601); z = linspace(-3,3,601); %leave z as a matrix, instead of using it as a for loop co...

presque 9 ans il y a | 0

Réponse apportée
Each time I write my code I get this error 'Subscript indices must either be real positive integers or logicals.'
The issue is you are accessing a matrix using a non-integer index. That's not allowed in MATLAB. t = 0:0.05:40 %this is n...

presque 9 ans il y a | 0

| A accepté

Charger plus