Réponse apportée
How can I export text and numeric data from excel to uitable (GUI element)
According to the docs, when you set the Data property of a uitable created with the figure function, you must set it to a numeri...

plus de 5 ans il y a | 0

Réponse apportée
cellfun vs. varfun applied to column of table
varfun passes entire variables from your table into your function. It calls your function once per table variable. The variable ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
rotate colorbar tick labels
You could place the labels yourself using text. Personally, I'd rather MATLAB figure out the placement. Here's code which puts ...

plus de 5 ans il y a | 0

Réponse apportée
transform fprintf in disp
Maybe this? disp(sprintf('\nPara i= %d\n e a= %f e a resposta é: %f ', i, n, c)) You'll get a warning that fprintf is prefe...

plus de 5 ans il y a | 0

Réponse apportée
Adding Legend to a multiple graph within a loop
The legend should show after you call legend(), i.e.: clear all close all clc hold on data=dlmread('data.txt') for i= 1:27...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
assume(x^2 == y) doesn't work
From the docs, "assume is not additive. Instead, it automatically deletes all previous assumptions on the variables in conditio...

plus de 5 ans il y a | 0

Réponse apportée
Histogram with adjusted bins to gaussian
If you'd like to fit a histogram to a normal distribution but you don't know the underlying data (e.g. you've altered the histog...

plus de 5 ans il y a | 0

Réponse apportée
MATLAB drawrectangle ROI custom wait function difficulty
Store the figure in h so that when you later call close(h), MATLAB knows what h is: h = figure(1);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to edit grid lines on a 3D plot
It seems to me that Dillen.A's answer from your link is pretty elegant. Adapting that code to work with 3D axes: f = figure; ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Matlab Sort Command Output
How about this? x1=3; x2=1; x3=2; a=[x1 x2 x3]; varNames = {'x1','x2','x3'}; [~, idx] = sort(a); fprintf('Output:\n%s\n',...

plus de 5 ans il y a | 1

Réponse apportée
Compare elements from two matrix.
How about this? x = x1; idx = abs(x1) < abs(x2); x(idx) = x2(idx);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Subscript indices must either be real positive integers or logicals.
thetat=0:0.012566:0.6283; for idx = 1:numel(thetat) % use thetat(idx) to access the appropriate theta value in any iterati...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Value assignment to vector, without loop
Here's an option: N = 20; idx = (1:N)'; out = (idx >= frm & idx <= to)*value'; The indices in frm and to can't overlap, and ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
How do you display a users input into an questdlg command?
fprintf prints text to a file which corresponds to the supplied file ID or, if you don't supply a file ID, the command window (f...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How can i prevent the plots from appearing while still using them as frames for the movie function?
Plot your frames on a figure whose Visible property is set to 'off': fig = figure('Visible', 'off'); ax = axes(fig); x = lins...

plus de 5 ans il y a | 0

Réponse apportée
Vectors must be the same length with plot of Shear Force Diagram
If you look in the workspace, you should see that X has length 200 while V has length 101. If you want to plot V over X, they ne...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
subplot question - with image and plot
This is possible by setting the parent axes in your call to imshow: subplot(1,2,1); plot(rand(10,1)); ax = subplot(1,2,2); i...

plus de 5 ans il y a | 0

Réponse apportée
Matlab 3 variable function plot
You can pick any interval. Your plot will only show something if solutions to f=0 lie within the interval. [0, 0, -b1/Beta(3)] i...

plus de 5 ans il y a | 1

Réponse apportée
Error using plot !
z has length (44100 1/s) * (5 s) = 220500. t has length 220501. You could use linspace to ensure t has the correct length: t = ...

plus de 5 ans il y a | 0

Réponse apportée
Display data in matrix with two different colour scales, depending on cell value
This first bit of code sets up a colormap with 2*N colors ranging from dark green to light green to light red to dark red: N = ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Change color to grey
colormap([0.86 0.86 0.86]) freqz2(abs(h,[32 32]));

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
To get 100 vectors using the previous vector
Better to not name the arrays Q1, Q2, Q3... Q = cell(100,1); Q{1} = Q1; for i = 2:numel(Q) Q{i} = F*Q{i-1}; end

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Haunted Code (Serious)
That is the default image upside down. You can view it by calling just >> image When you call imshow(image); MATLAB first ev...

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
How can i plot surfaces for a recursive function?
Try this: for n = 0:5 ax = subplot(2,3,n+1); fsurf(ax, @(x,y) F(n,x,y), [-1 1]) end

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Why does the signature of my method change at runtime?
You can either reference your function with @(block, event) app.updateSpeed(block) or @(block, event) updateSpeed(app, block)...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Matrix Indexig or how to access values of a matrix
You could convert to linear indices: solution = A(sub2ind(size(A),index(:,1),index(:,2)));

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
split a 2d matrix and create new 3d matrix from the results of the 2d matrix
I believe this should do what you want: Matrix_T_A = permute(repmat(T_A, 1, 1, 24), [3 2 1]); Using the for loop, T_A(i,:).*...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Plot surface from a stored handle (handle of a surface) in .mat file
How about this? set(sobf, 'Parent', gca) If you want to save the view, gridlines, ticks, anything else about the axes rather t...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Plot matrix values as colors in a checkerboard pattern
Why red? What if some real data is mapped to red? You are right about the -1 values messing things up. But the 0s on the border...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Problems with xaxis ticks and labels
The x axis limits are from 1 to 34, based on your box plot. When you call hold on and then plot a line from 0 to 35, the limits ...

plus de 5 ans il y a | 0

| A accepté

Charger plus