I believe your are right about the xscale options. These are regular axes to use in plots. If you want your data to show up as a straight line, change your data in stead by taking log of your x-values, when you plot. Just remember to change xlabel accordingly to show what you have done.

E.g.

plot([1,10,100],[3,2,1])
set(gca,'xscale','log')
xlabel('x')

can be shown as

plot(log10([1,10,100]),[3,2,1])
xlabel('log10(x)')

EDIT: You can alter XTick and XTickLabel manually like this in stead

set(gca,'XTick',log10(x))
set(gca,'XTickLabel',{'10^0','10^1','10^2'})
Answer from Solstad on Stack Overflow
🌐
Johns Hopkins University
math.jhu.edu › ~shiffman › 370 › help › techdoc › ref › log2.html
log2 (MATLAB Function Reference)
Description Y = log2(X) computes the base 2 logarithm of the elements of X. [F,E] = log2(X) returns arrays F and E. Argument F is an array of real values, usually in the range 0.5 abs(F) < 1. For real X, F satisfies the equation: X = F.*2.^E.
🌐
MathWorks
mathworks.com › fixed-point designer › embedded implementation › function approximation with lookup tables › implement lookup tables in matlab
Implement Fixed-Point Log2 Using Lookup Table - MATLAB & Simulink
Generate lookup table, LOG2LUT, such that the integer i = x_B - 2^(B-1) + 1 is used as an index to LOG2LUT so that log2(x_B) can be evaluated by looking up the index log2(x_B) = LOG2LUT(i).
🌐
MathWorks
mathworks.com › matlabcentral › answers › 365748-how-to-write-log-base-2-in-matlab-coding
how to write log base 2 in matlab coding - MATLAB Answers - MATLAB Central
November 8, 2017 - https://www.mathworks.com/matlabcentral/answers/365748-how-to-write-log-base-2-in-matlab-coding#answer_289969 · Cancel Copy to Clipboard · Y = log2(X) Sign in to comment. Andrew Rockhill on 16 Sep 2022 · 0 votes · Share · Translate · Share ...
🌐
MathWorks
mathworks.com › matlab › mathematics › elementary math
Exponents and Logarithms - MATLAB & Simulink
In addition to common functions like exp and log, MATLAB® has several other related functions to allow flexible numerical calculations. The expm1 and log1p functions compensate for numerical round-off errors in small arguments, while the reallog, realpow, and realsqrt functions restrict the ...
Find elsewhere
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1570383-log2-only-works-with-double-types
log2() only works with double types? - MATLAB Answers - MATLAB Central
October 24, 2021 - Check MATLAB documentation and this fucntion log2 supports type single or double as the input argument type.
🌐
Cvxr
ask.cvxr.com › t › how-do-you-solve-the-log2-problem › 11986
How do you solve the log2 problem - CVX Forum: a community-driven support forum
November 9, 2023 - code is ‘nu_rc<=log2(real(trace(H_rc_het * U_r)+trace(H_rr_het * U_r)+trace(H_rt_het * U_r)) + No)-beta_rc_d;’ This is the line inside the constraint that gives an error. The variable in this line is ‘nu_rc,U_r,beta_r…
🌐
Scilab
help.scilab.org › docs › 5.5.0 › en_US › m2sci_log2.html
log2 (Matlab function) - Base 2 logarithm and dissect floating point number
April 11, 2014 - Scilab log2 is equivalent to Matlab log2 for logarithm computation, but for floating point number dissection, Scilab equivalent to Matlab log2 is frexp.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 579159-logarithmic-scale-with-a-different-base
Logarithmic scale with a different base - MATLAB Answers - MATLAB Central
August 13, 2020 - Hi, I am trying to plot a function using logaritmic scale on the x axis, with base 2. my code is: N = 1:10000; M = 61; L = N-M+1; ova_complex = ((N.*(log2(N)+1))./(N-M+1)); figure stem(log...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1853103-base-2-logarithmic-scale-on-bar-diagram
Base-2 logarithmic scale on bar diagram - MATLAB Answers - MATLAB Central
November 16, 2022 - https://www.mathworks.com/matlabcentral/answers/1853103-base-2-logarithmic-scale-on-bar-diagram#comment_2468303 · Cancel Copy to Clipboard · What, specifically, is the expected result to look like? Since · log2(y)=log10(y)/log10(2) by definition, ...